I have two very simple OSA scripts to allow logging in and logging out in a lab environment. These scripts work flawlessly in Snow Leopard when pressed through ARD, interactively in an ssh session, but they do not work on machines that Lion runs on.
Having split up to its core, the logout script looks like this:
osascript -e 'tell the System Events program to exit the system
- WORKS when launched directly from the interactive shell on the machine
- WORKS when pressed from ARD
- FAILS with "runtime error: out variable not defined. (-2753)" when starting from ssh session
- WORKS when the script is compiled into .scpt, then run from ssh (for example, "/ usr / bin / osacript logout.scpt")
The script input directly depends on this. An outdated version that detects a problem:
osascript -e 'tell the System Events program to the frontend key
- WORKS when launched directly from an interactive session
- WORKS when pressed from ARD
- FAILS with runtime error: An error of type -10810 has occurred. (-10810) when starting from ssh
- WORKS when executed as compiled scpt and executed from ssh
Since these scripts work fine in interactive mode, and because they worked perfectly in all modes in Snow Leopard, I think something should have changed in osascript, but I do not know that the error messages are not very descriptive either. Any suggestions are welcome.
paulr source share