GUI Scripting to FastUserSwitch

Hi all,
I’m trying to write a script that would allow me to automatically log a 2nd user when the computer starts up. It works fine when there is no password to enter. This is the script:

tell application “System Events”
tell process “SystemUIServer”
tell menu bar item -1 of menu bar 1
click
click menu item “TC” of front menu
end tell
end tell
end tell

The problems come when trying to log users with password. I can’t find a way to script the process of entering the password. I know it can be done because I did some months ago (but lost the source code).

Can anyone help me ?
Thanks
Antonio

Hi hungryduck

give this a shot

tell application "System Events"
	tell process "SystemUIServer"
		tell menu bar item -1 of menu bar 1
			click
			click menu item "TC" of front menu
			delay 1
			---------
			keystroke "BUDGIE" --hard coded password
			----------
			delay 1
			keystroke tab
			keystroke return
		end tell
	end tell
end tell