Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Two suggestions:' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Two suggestions:
Authored by: mithras on Nov 09, '01 10:27:23AM
First, to allow this script to be run via SSH from another machine: (as I note in the MacNN forum where David also posted this) Change the Applescripts slightly to use the Remote AppleEvent syntax:
tell application "iTunes" of machine "eppc://127.0.0.1" to play the current track
For the above to work, you'll need: (1) To click the checkbox "Allow remote Apple Events" in the Sharing control panel (2) To be physically present at the machine to enter authorization name & password. If you save the authorization to your Keychain, you won't have to enter it again. This loops back the AppleEvents to the same machine that you are SSH'd into, which presumably is the same machine where iTunes is running. I imagine you could also change the IP address from the loopback 127.0.0.1 to the IP of whatever machine is running iTunes; this would let you run the scripts on a local Terminal, to control a remote iTunes.
Second, to speed up the scripts: Applescript is compiling those scripts each time. It would be faster to precompile them, using the Script Editor or the osacompile tool, and save them to separate files. Then change the shell script to 'osascript /Library/Scripts/iTunes/play.scpt' or whatever location you settle on. It's still not exactly speedy, but it helps.

[ Reply to This | # ]
Two suggestions:
Authored by: eskilling on May 30, '02 04:24:40PM

I've made the changes but the problem I seem to be running into is this error:

can't get the applications event dictionary (-2709)

I got this before I made the changes to David's original script. It runs great locally but if I ssh from another machine I get that.



[ Reply to This | # ]
Two suggestions:
Authored by: David Kennedy on Mar 17, '03 05:31:49PM

Okay, I have compiled the various small functions ('play', 'pause', etc) as AppleScripts, but am puzzled as how to manage the 'vol' one? Any suggestions as to how to handle this one? I'm new AppleScript and dunno how to pass params etc.



[ Reply to This | # ]
Run as ssh
Authored by: logo on Mar 18, '03 04:42:41AM

You will probably not need the addition of the host inside the applescript.

Assuming you have installed the script on the target machine you can run it remotely using ssh.

Once the ssh login to the machine running itunes has succeeded the applescript is executed locally right there...

you can even run the script in one line with:
ssh <login here>@<remotemachine here> /<pathtoscript>/itunes play
this will prompt for the password and then your itunes will come to life!!!



[ Reply to This | # ]