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

Start iTunes Remotely using ssh Network

This isn't a revolutionary tip -- it just puts together several well-known tricks into something useful. Today I was downstairs with my iBook, and I wanted to play some music. Thanks to iTunes4, I can play all the songs in my desktop G4's library via the wireless network. That's great, because now I can keep everything in one place, and the G4 can be the music server for the entire house.

But two problems: The G4 is upstairs in my home office, and iTunes wasn't running. he easy solution is, of course, for me to get off my ass, trudge up the stairs, call up the dock, and start iTunes. Then go back downstairs and enjoy my music on the iBook. But, like any good computer geek, I'm lazy. So instead I did this:

  1. Use ssh to log on remotely to the G4.
  2. Give this command: open -a iTunes
  3. Upstairs, the G4 starts up iTunes.
  4. Log off the G4, and enjoy the music on the iBook.

In step one, I could have used telnet instead of ssh, if the G4 were set to allow it, but ssh is more secure, of course. And of course, the library will only be available if I've previously set the G4 to share its music library. Hopefully this tip will be a useful reminder to anyone as lazy as I am: You can log on remotely and use the open command to start up any app you might need.

[robg adds: Yes, it's basic, but useful and not (near as I can tell) published here before in this general form. I do a similar thing to launch VNC (a remote control client), as described in this hint.]

    •    
  • Currently 2.80 / 5
  You rated: 3 / 5 (5 votes cast)
 
[13,515 views]  

Start iTunes Remotely using ssh | 14 comments | Create New Account
Click here to return to the 'Start iTunes Remotely using ssh' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Start iTunes Remotely using ssh
Authored by: Gigacorpse on May 13, '03 10:52:58AM

Can't you control a networked Mac, and its scriptable applications, via Applescript? I seem to remember Apple touting this abililty with Mac OS 9 but I haven't heard anything about it in a long while.



[ Reply to This | # ]
Start iTunes Remotely using ssh
Authored by: njitkoff on May 13, '03 06:11:45PM

you should be able to do something like this, but I cannot test at the moment:

tell app "iTunes" of machine "eppc://10.0.1.100" to activate

you will need to have remote apple events turned on.



[ Reply to This | # ]
Start iTunes Remotely using ssh
Authored by: skinnyjimmy on May 13, '03 11:55:06AM

now, that only works if you are also graphically logged in (I think) - is there any way to log someone into the gui through ssh as well?

james



[ Reply to This | # ]
I don't think so
Authored by: extra88 on May 13, '03 01:03:27PM

If you want to remotely login an account at the GUI, you need to use VNC or another remote control service. Also iTunes can't run "headless," that is, it can't run if there's no one logged in so iTunes can show its GUI.



[ Reply to This | # ]
Start iTunes Remotely using ssh
Authored by: verence on May 13, '03 07:32:51PM

Not quite. You are able to start the VNC server from the login screen if you ssh in as root and start it like that. You could then do whatever you need to.



[ Reply to This | # ]
Start iTunes Remotely using ssh
Authored by: macubergeek on May 13, '03 02:56:57PM

can also do:
open /Applications/iTunes.app



[ Reply to This | # ]
Wont work unless...
Authored by: SOX on May 13, '03 04:27:50PM

this hint wont work if the "upstairs" mac is not logged in at the gui.

you could however run OSXVNC server.



[ Reply to This | # ]
Start iTunes Remotely using ssh
Authored by: jjones on May 13, '03 04:48:43PM

iHam on Rye is a great little app that will do the same thing over any network. It will also allow you to choose playlists, etc. Granted you have to have a client installed on each machine, but it works very nicely. It will even let me control a machine running classic with my osx 'book



[ Reply to This | # ]
Start iTunes Remotely using ssh
Authored by: foobar104 on May 13, '03 05:08:43PM

Now if only it were possible to wake a remote machine via AirPort. If I'm not sitting in front of my G4, it's sleeping.

I know it's possible via the built-in Ethernet port, but as far as I know it simply can't be done over AirPort. Oh, well. Guess I'll have to actually get up off my butt. Easy come, easy go.



[ Reply to This | # ]
You can wake up a sleeping Mac
Authored by: drush on Jul 20, '03 08:14:41PM

If you have your cell phone and the Mac is set to "Wake when modem detects a ring" in Energy Saver prefs, just phone home and hang up when Mac wakes up and the use airport.



[ Reply to This | # ]
Playing songs remotely
Authored by: verence on May 13, '03 07:42:06PM

In the case that you can't set up VNC on the computer or you just want to have a command line interface to songs, you can simply use one of the command line media players (mpg123, mplayer).

IE - specifically for MP3's, you could download mpg123 using fink or some other method, then simply copy the file to an easily accessible location (make sure to change it +executable (ie, chmod u+x mpg123)) and then run it by /location/to/file/mpg123 /location/of/mp3toplay

If the computer you're running that on has apple events enabled, you could probably even turn up the volume using some other script. Of course, if it has apple events enabled you wouldn't need to necessarily use the command line script; you could just use the syntax mentioned in another hint.



[ Reply to This | # ]
Playing songs remotely
Authored by: foobar104 on May 14, '03 01:20:35PM

I think you might be missing the point just a little bit. I'm sure that a lot of people would like to be able to start up iTunes remotely so they can connect to it over Rendezvous and stream their music libraries.



[ Reply to This | # ]
Playing songs remotely
Authored by: verence on May 14, '03 01:53:02PM

Well, actually, I didn't miss the point. I thought to myself - 'wow. cool. that's a cool way to turn on sharing.'

But I also felt like sharing this little piece of info - it certainly doesn't merit its own hint, but it's the type of thing people might look for for a long time before coming up with the answer.



[ Reply to This | # ]
Start iTunes Remotely using ssh
Authored by: fivefifty on May 14, '03 05:29:45PM

If you are not the current user or don't know who the current user is, you can use this hint by first sshing in as yourself and typing:

who

The word "console" will appear next to the logged in user. If you know that persons password, then you can type (assuming the logged in user's name is "foo"):

su foo

and then type

open /Applications/iTunes.app



[ Reply to This | # ]