Running a Script on a Remote Machine

I have an AppleScript App on my MacBook Pro that must run there because its target application runs under Rosetta (I’ve left Snow Leopard as the MBP’s OS for that reason). It’s a script to run an external USB-controlled power outlet set. I’d like to be able to run this from my iMac over my LAN. I realize I could do this by Screen Sharing or SSH, but I’m looking for an AppleScript method. Is there one?

SSH and appleScript is possible as I have posted here to execute remote shell commands

I have bad experience with remote apple events but that could be an option as well.

edit: fixed link

I wrote this little script:


tell application "finder" of machine "eppc://10.0.1.4"
	set PwrOnOff to alias "Address_of_AppleScript.app_here"
	open PwrOnOff
end tell

The only PITA is that it requires a login every time, but it works.

You can pass username and password in the eppc URL


eppc://username:password@10.0.1.4

Makes me cringe to put a password in a script, but given that this is a single-access machine, it works nicely. Thanks Stefan.

More secure solution


tell application "Keychain Scripting" to set {password:pass_word, account:user_name} to first key of current keychain whose name is "whatEverItsNameIs"

tell application "Finder" of machine "eppc://" & user_name & ":" & pass_word & "@10.0.1.4"
   set PwrOnOff to alias "Address_of_AppleScript.app_here"
   open PwrOnOff
end tell


In Lion, the keychain saves the username properly, but not the password for some reason. Looking into it.