Use AppleScript to disable Gracenote in iTunes

Oct 25, '05 06:30:00AM

Contributed by: mundie1010

This is a short and obvious hint, but it took me a fair amount of research to come up with it, so I thought I'd share it here.

The fact that iTunes 5.0 unconditionally contacts Gracenote is not just annoying, it can also break the functionality of any script that involves CDs. If, for example, Gracenote returns multiple hits, iTunes puts up a possibly-obscured dialog box waiting for a reply, causing the invoking script to hang.

The solution is to use ipfw to block outgoing calls to service.gracenote.com. Here is my AppleScript which does just that:

set d to display dialog ¬
  "Disable or Enable Gracenote?" buttons ["Disable", "Enable", "Cancel"] ¬
  default button 3
set r to (button returned of d)

if r is "Disable" then
  do shell script ¬
  "ipfw add 099 deny ip from any to service.gracenote.com" ¬
  with administrator privileges
end if
if r is "Enable" then
  do shell script "ipfw delete 099" with administrator privileges
end if
Caveats:
  1. If you have configured the OS X firewall in System Preferences, this will interfere with those settings.
  2. I'm not an ipfw expert; this works for me, but it may be necessary to enable ipfw first or something.
[robg adds: I haven't tested this one...]

Comments (4)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20051022121331951