This script example shows how to combine AppleScript with Apple Remote Desktop's "Send UNIX Command" to enter a username and password at the login window of a Mac you control.
osascript -e 'tell application "System Events" to keystroke "REPLACE_WITH_YOUR_USERNAME"';
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 "REPLACE_WITH_YOUR_PASSWORD"';
osascript -e 'tell application "System Events" to delay 0.5';
osascript -e 'tell application "System Events" to keystroke return';
Replace the two strings with your username and password. Note: there are some single and double quotes in the script above, so edit carefully.
Not that I would enter in a password into a script permanently. But, for a quick run of the script using a dedicated account for this purpose could be useful when combined with other routines.
Thanks Tony! Happy Computing.
No comments:
Post a Comment