Here's the long and short of it:
I have a large number of systems running 10.7.5 that need to have data backed up to a network share (as a failsafe only) before they can be upgraded to Mavericks. Ideally, this script needs to run from start to finish in Casper Remote: it logs the computer in from the welcome screen to a predetermined user account; mounts a network share using osascript events, and then runs rsync on the /Users folder. I would have used "mount_smbfs -o nobrowse ... " but Samba is horribly broken in Lion and I get "authentication error" even though I've triple-checked everything. So my only other option is to do everything through the GUI, and that calls for AppleScript.
I've tried at least 6 variations of an automated login sequence that relies on AppleScript / osascript, but they're not working at all on 10.7. I used to work at a lab with about 40 Macs running 10.4, and then at two different medium-sized companies with 400 Macs running 10.5 and 10.6. I was always able to use ARD to set off a series of commands using osascript that tell System Events to send some keystrokes. This would magically fill in the login fields and press Enter when done. Those of you who are reading this know what I'm talking about.
As of 10.7, however, the "osascript" trick does not work in ARD as it used to. It doesn't work when run as root, either locally or remotely via ssh (manual login or Casper Remote).
I've searched this forum and many other places for ways to get it to work; however, I get one of the following errors from osascript:
36:52: execution error: An error of type -10810 has occured
91:98: syntax error: A number can’t go after this identifier. (-2740)
46:47: syntax error: Expected end of line but found “"”. (-2741)
I have verified that there aren't any "Smart Quotes" in the files.
I am only using TextMate and nano to edit the scripts.
They all have 755 permission.
I've tried running the osascript line-by-line at the command line.
I've tried the following solutions, and as many user-suggested alternatives as I could find:
https://jamfnation.jamfsoftware.com/discussion.html?id=5560
https://jamfnation.jamfsoftware.com/featureRequest.html?id=770
https://groups.google.com/forum/#!msg/macenterprise/MO3qhulRpJY/ktKOjMMxk1EJ
http://hints.macworld.com/article.php?story=2010021119293586
http://hints.macworld.com/article.php?story=2005062918513721
https://discussions.apple.com/message/20625863
Everything that people are saying works, doesn't for me.
Have I overlooked something?
Thanks!