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


Click here to return to the 'Script the Login window through Apple Remote Desktop' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Script the Login window through Apple Remote Desktop
Authored by: patrickfergus on Feb 16, '10 08:20:30AM
I think the above hint requires enabling access for assistive devices. At least that's the error I got when I tried to use it. This may be an alternative without enabling access for assistive devices, but with the following caveats:

- Our login windows are username and password blanks, while the original hint includes code to reach the "Other" entry in a list-style login window

- The original hint includes code to deal with the screen saver/energy saver, mine assumes a computer at the ready

- If you have a non-Mac keyboard attached to the computer the script will likely not work. The keystrokes seem to be eaten rather than passed through

- I've used this only on 10.5, but I've used it a lot in 10.5


username=YYYYYYYY
password=XXXXXXXX

#Sanity checks
if [ $username = YYYYYYYY ]
then
	echo You need to set the username
	exit 1
fi

if [ $password = XXXXXXXX ]
then
	echo You need to set the password
	exit 2
fi

#Close the Bluetooth setup assistant, if there is one
osascript <<EOT
tell application "System Events"
        keystroke "w" using {command down}
end tell
EOT

#Wait a little bit for everything to work
sleep 5

#Type in the username, password, and press return
osascript <<EOT
tell application "System Events" to keystroke "$username"
tell application "System Events" to delay 2
tell application "System Events" to keystroke tab
tell application "System Events" to delay 2
tell application "System Events" to keystroke "$password"
tell application "System Events" to delay 2
tell application "System Events" to keystroke return
EOT


[ Reply to This | # ]