Tuesday, August 5, 2008

Logging in as a user via commandline to the loginwindow

This is from macoshints.com.  I could not get it to work past bringing
up the users login name and presenting the password field, but it may
provide some bread crumbs for the adventurous.

osascript -e 'tell application "System Events" to keystroke "LOGIN_NAME"'; \
osascript -e 'tell application "System Events" to keystroke tab'; \
osascript -e 'tell application "System Events" to delay 0.5'; \
osascript -e 'tell application "System Events" to keystroke "PASSWORDHERE"'; \
osascript -e 'tell application "System Events" to delay 0.5'; \
osascript -e 'tell application "System Events" to keystroke return'

No comments: