0

I have an Applescript to quit my local iTunes, access a remote computer and open iTunes there:

tell application "iTunes" to quit

set remMachine to "eppc://user@0.1.2.3.4"

tell application "iTunes" of machine remMachine to activate

The following error is returned:

error "iTunes got an error: Application isn’t running." number -600

Yeah, tell me about it. You tell an application to 'open' and it fails because it isn't open.

How can I open an application on a remote machine?

Edit: I have tried changing the script to:

tell application "iTunes" to quit

set remMachine to "eppc://user@0.1.2.3.4"

tell application "Finder" of machine remMachine to do shell script "open /Applications/iTunes.app"

but the returned error is now:

error "Finder got an error: Handler does not allow remote events." number -10016

This is actually incorrect as remote events are enabled in System Preferences.

  • idk how to fix the issue as written - but I wouldn't think you'd tell Finder to "open..." you'd tell System Events – Tetsujin Oct 22 '16 at 15:01
  • Good thought, but returns: error "System Events got an error: Application isn’t running." number -600 – Pwdr Oct 22 '16 at 15:09
  • I found a whole page on the subject, idk if it's any use [I can't test here] - macscripter.net/viewtopic.php?id=19859 – Tetsujin Oct 26 '16 at 6:49
  • @Tetsujin: looks good. I'll try it and let you know. – Pwdr Oct 26 '16 at 6:58
1

Thanks to @Tetsujin for this link which provided the details for the answer.

My script now looks like this:

tell application "iTunes" to quit set remMachine to "eppc://user@0.1.2.3.4" tell application "Finder" of machine remMachine open file "Macintosh HD:Applications:iTunes" end tell

This does the following:

  1. Quits the local instance of iTunes
  2. Sets the details of the 'remmachine'
  3. Opens iTunes on the remote machine
  • Glad you got it :) Don't forget to mark it as the accepted answer, for future Googlers. – Tetsujin Oct 27 '16 at 12:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .