Easy script no longer easy in Leopard

Good morning,

I’m sure this is an easy question to most but this login osascript (pushed out via ARD) that works great in Tiger no longer seems to work in Leopard:


osascript <<EndOfMyScript
tell application "System Events"
	keystroke "student"
	keystroke return
	delay .5
	keystroke tab
	delay .5
	keystroke return
end tell
EndOfMyScript

This is a very basic way of logging in a managed user that has no password credentials. Does anyone know a work around for this?? The user id is 502 in case it’s needed.

Thanks,
Antnee

Where is it failing? In other words, does it keystroke student and then fail when trying to keystroke return? If it doesn’t keystroke student then maybe you need to add a keystroke tab first to put the cursor in the proper field.

About a year ago I read that keystroke ‘return’ didn’t work on Intel Macs.
Maybe that’s your problem - if so - try this…

osascript <<EndOfMyScript
tell application "System Events"
	keystroke "student"
	keystroke (ASCII character of 13)
	delay 0.5
	keystroke tab
	delay 0.5
	keystroke (ASCII character of 13)
end tell
EndOfMyScript

Tom

Operating System: Mac OS X (10.5)

Thank you Tom for the response and excuse my delay, things in the computer lab have been extremely hectic.

Anyways I read your posting a week ago and thought to myself that definitely makes sense. Evidently it doesn’t to my Leopard clients though. I’m thinking the whole osascript thing is not compliant with Leopard perhaps?? Anyone…? I’ll research it on Google, but right now it looks as if only other UNIX commands via ARD are working fine.

After doing a bit of research it seems that there a vulnerability a few months back regarding remote root access through a terminal command using osascript. Since then Apple updated their ARD client (3.2.1) to presumably counteract the oversight. I’m sure I’m only taking into account part of the problem here - is osascript completely disabled through terminal ARD commands? Is there a way to remotely log into machines through ARD via an Applescript. I could care less if osascript is even used, I just want a simple way to push out scripts of mine to Leopard clients.

This question isn’t even involving admin users; it’s logging into managed accounts with no password access!

PS - the aforementioned code in my first post still works fine on Tiger 10.4.11 computers. Any assistance here will be greatly appreciated.