Posted on 04-24-2017 07:40 AM
I'm using the following to log into over 300 remote systems. The first time I run it on any system it fails, with an execution error, error type -10810. When I run it second time, the script runs, with the expected result.
osascript <<EOF
tell application "System Events"
keystroke "$4"
keystroke tab
delay 0.5
keystroke "$5"
delay 0.5
keystroke return
end tell
EOF
It's be nice to get this to run correctly, the first time I run it in Casper Remote. Anyone have any ideas as to why the first run fails, but the second time is the charm?
Thanks in advance!
Posted on 04-24-2017 08:15 AM
The first time I ran it the user name was not populated....
I changed the delay to 1
osascript <<EOF
tell application "System Events"
keystroke "username"
keystroke tab
delay 1
keystroke "password"
delay 0.5
keystroke return
end tell
EOF
Posted on 04-25-2017 05:34 AM
I attempted that, as well as changing the second delay to a full second, but the results were the same. The first run of the script fails, but if I retry and run it again, it works perfectly. I'm not certain why.