The personal website of Matt Henderson.
19 December 2005
I have iTunes running at home on a Mac mini, with a Harmon Kardon Soundsticks II system connected, and was looking for a way to control iTunes remotely, from another Mac. This page discusses setting up a PHP script on the remote machine, but involves some things I didn’t like much (like running the web server as a normal user). Also, managing iTunes via web URLs isn’t as convenient as I’d like.
What I finally decided to implement, was a number of shell scripts that can be run from QuickSilver. This works, is very convenient, and only relies on SSH key authentication (i.e. without password) to the remote machine.
Following are the shell scripts I now have. (Important: Note that the second and third lines of each script below are really one line in the shell script. I broke the line for display purposes here.)
With these in place, controlling iTunes remotely is a matter of command-space iNext return
. Great!
#!/bin/bash
ssh 192.168.2.130 "osascript -e 'tell application "iTunes"
to set sound volume to sound volume + 5'"
#!/bin/bash
ssh 192.168.2.130 "osascript -e 'tell application "iTunes"
to set sound volume to sound volume - 5'"
#!/bin/bash
ssh 192.168.2.130 "osascript -e 'tell application "iTunes"
to next track'"
#!/bin/bash
ssh 192.168.2.130 "osascript -e 'tell application "iTunes"
to previous track'"
#!/bin/bash
ssh 192.168.2.130 "osascript -e 'tell application "iTunes"
to pause'"
#!/bin/bash
ssh 192.168.2.130 "osascript -e 'tell application "iTunes"
to play'"
#!/bin/bash
ssh 192.168.2.130 "osascript -e 'tell application "iTunes"
to quit'"
#!/bin/bash
ssh 192.168.2.130 "osascript -e 'tell application "iTunes"
to start'"
Enjoy this article? — You can find similar content via the category and tag links below.
Questions or comments? — Feel free to email me using the contact form below, or reach out on Twitter.