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

An AppleScript to restart AirTunes Network
I recently picked up an AirPort Express to stream iTunes to my luxurious Apple Hi-Fi. However, it seems to lose the connection periodically, which is annoying at a minimum. I searched high and low and couldn't find a script to address this issue, so here is one I whipped out.

What it does:
  1. Checks to see what time it is.
  2. If reasonable time, checks to see if speakers are there.
  3. If no speakers found, announces a restart and restarts iTunes and clicks play.
  4. Post to the system log as we go so we know the script ran.
It's a rather clunky way to fix the issue; a better way would be just to enter the secret command that iTunes is sending, but how do I trap that? I also have a script that will restart the AirPort Express. However, I have not found a need for it yet, since restarting iTunes (6.0.2) seems to fix the issue. For this script to work, your speakers need to be named "Speakers" or "Fred's Speakers" or "Pokey's Speakers" -- or anything else with "speakers" in their name. I used Cronnix and put this in a cron script (yes they still work in Tiger) and it runs every 15 minutes.

[robg adds: I haven't tested this one.]
    •    
  • Currently 3.33 / 5
  You rated: 5 / 5 (3 votes cast)
 
[9,982 views]  

An AppleScript to restart AirTunes | 3 comments | Create New Account
Click here to return to the 'An AppleScript to restart AirTunes' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
date's hours
Authored by: airdrummer on Jun 06, '07 10:43:21AM

u really don't have to parse the string representation of a date:

set curTime to (current date)
set curTime to curTime's hours
if curTime < 8 or curTime >21 then return



[ Reply to This | # ]
An AppleScript to restart AirTunes
Authored by: macron1 on Jun 06, '07 09:18:52PM

Periodically drops its connection? maybe its bung. i have had an AP running airtunes for maybe 2 years now, in a variety of environs and have never had such a problem. Maybe you should take it back.



[ Reply to This | # ]
An AppleScript to restart AirTunes
Authored by: dethbunny on Jun 07, '07 11:40:30AM
Could be general wireless traffic difficulties. Have you tried switching to a different channel?

...or maybe it's old software. iTunes 6.0.2!? Update your AirPort Express to the latest firmware version using Airport Admin Utility. Update iTunes to 7.2. There are bug fixes in new versions, you know. =)

[ Reply to This | # ]