Open Remote App

Having trouble getting an Applescript to launch an app on a remote machine.
This will work sporadically:

tell application “iTunes” of machine “eppc://Carl-Mac-2.local:xx@192.168.1.xx”
activate
end tell

I also have a script saved as an app in the Applications folder called iTunesPlay on the remote machine and find that this script never works:

tell application “iTunesPlay” of machine “eppc://Carl-Mac-2.local:xx@192.168.1.xx”
activate
end tell

The error I get is “Application isn’t running”

If iTunes is running all other commands work fine, e.g. quit, play, stop, etc…it just will not load.

Any idea what may be going on here?

Thanks,

Carl

Hi,

you cannot launch an application on a remote machine directly,
use the Finder to check the status and launch iTunes.
Although process is not listed in the dictionary, the Finder responds to it.


tell application "Finder" of machine "eppc://Carl-Mac-2.local:xx@192.168.1.xx"
	using terms from application "Finder"
		if "iTunes" is not in (get name of every process) then
			open application file id "com.apple.iTunes"
			repeat until "iTunes" is in (get name of every process)
				delay 1
			end repeat
		end if
	end using terms from
end tell

Perfect, thanks a bunch! Should this work for launching a script I have saved as an app called iTunesPlay?

I have the script saved as an app in the Applications folder but simply changing the naming in the script
you provided isn’t working yet. Should it work?

Many thanks,

Carl

I don’t think so, because AppleScript applets have generic bundle identifiers

Thanks, appreciate the help. Have to try something else.
I have an app called Arduino that if I replace the names in your script won’t load:

tell application “Finder” of machine “eppc://Carl-Mac-2.local:xx@192.168.1.xx”
using terms from application “Finder”
if “Arduino” is not in (get name of every process) then
open application file id “com.apple.Arduino”
repeat until “Arduino” is in (get name of every process)
delay 1
end repeat
end if
end using terms from
end tell

Curious, shouldn’t any app load this way?

Carl