Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Remote GUI login via Apple Remote Desktop' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Remote GUI login via Apple Remote Desktop
Authored by: topkat2000 on Aug 17, '05 01:53:00PM

This is an awesome tip, and I would really love to use it in our lab...but there is one problem. The last line of the script isn't working...the "keystroke return" isn't being processed by the machines correctly.

Instead of a return being entered, and the login proceeding, the password field simply becomes highlighted. If I then physically press return on the machines' keyboards, the login proceeds. Anyone have any idea why the keystroke return would not be processed correctly and truly result in a return? I'm using 10.4.2... might it be some sort of security setting? Thanks in advance!



[ Reply to This | # ]
Remote GUI login via Apple Remote Desktop
Authored by: kraaft on Nov 09, '05 03:46:15AM
This happens when your users are displayed as list. Here's a modified script. To choose the desired user enter just as many characters as are need to identify it.

osascript -e 'tell application "System Events"' -e 'keystroke "CHARACTERS"' \
-e 'keystroke return' \
-e 'delay 1' -e 'keystroke "PASSWORD"' -e 'delay 0.5' -e 'keystroke return' \
-e 'end tell'
You can also experiment with the delay times

[ Reply to This | # ]
Remote GUI login via Apple Remote Desktop
Authored by: YB on Mar 15, '06 09:29:10AM

Was anyone able to find a solution for the "keystroke return" problem?
It seems the username and password gets entered on the 10.4 server GUI login but "return" does not take place.

Any idea.



[ Reply to This | # ]
Remote GUI login via Apple Remote Desktop
Authored by: genericuser on Mar 17, '06 03:57:52PM

Blah. Can't remember my username or password for this site, but it won't send a new e-mail to my account, because it's apparently already in the system. Sheesh.

Anyway, I figured out the fix.

osascript -e 'tell application "System Events"' -e 'keystroke "USERNAME"' -e 'keystroke tab' -e 'delay 0.5' -e 'keystroke "PASSWORD"' -e 'delay 0.5' -e 'keystroke tab' -e 'keystroke return' -e 'end tell'

Not sure why, but you need to pass a tab instance between entering the password and sending the final return key command. Don't ask me why I even thought to try this; I have no idea. But it fixed the problem, which I was also having. :)

HTH --



[ Reply to This | # ]
Remote GUI login via Apple Remote Desktop
Authored by: osso on Feb 06, '07 03:27:03PM

I had this trouble too and have spent hours and hours on this. I finally got the command to work with 5 returns at the end. I actually had to run the command twice. I am not a programmer but I couldn't find anyone that had cleaner code and who cares it runs.



osascript <<EndOfMyScript
tell application "System Events"
keystroke "USERNAME"
keystroke tab
delay 0.5
keystroke "PASSWORD"
delay 0.5
keystroke return
keystroke tab
delay 0.5
keystroke "PASSWORD"
delay 0.5
keystroke return
keystroke return
keystroke return
keystroke return
keystroke return
end tell
EndOfMyScript


I hope that helps because I signed up with Mac OS X hints just to let you know what I found.



[ Reply to This | # ]