2006-07-09

iTunes AppleScript Podcasts, Skip and Bookmark

iTunes Multiple Song Information settingsI have moved all of my iTunes content over from my laptop, which was mostly podcasts, and all of my music from my home desktop to my iMac. The podcasts I listen to have taken up a huge amount of room (16Gig) because I don't like deleting things, so my laptop thanks me for the free space, and my iPod is now connecting directly to another piece of Apple hardware to get it's updates.

I have found that my iPod Nano has vastly changed the way I listen to music. Basically I don't anymore. I will visit the iTunes store and very rarely I will spend some of the iTunes voucher money my sister got me for Christmas on music that sounds good. I will play this music a bit and think that all is not lost in the music world. I may even burn the music to CD to play in the car. Which I generally don't. I will not listen to the music again for quite a while. However I will make lots of use of the iPod. "How is this possible?!" I hear you scream, the answer is: Podcasts.

Podcasts, for the uninitiated, are audio shows published on the net that you can download using free software like iTunes. They can be about anything and are almost always free. Radio has taken to podcasting, often making shows available over the internet very quickly after their initial airing (Thank you ABC for Dr Karl, Science Show, Health Report, Spirit of Things etc). However there are also a number of home grown podcasts created by technical people and others who have some of the most interesting stories to tell, or inside insight into industry news.

So now the sole purpose of my iPod seems to be playing podcasts while I am in transit.

With the copying over from the laptop to the Mac, iTunes recognised the podcasts for what they were, but messed up some of the settings. Most notably "Skip when shuffling"(Shufflable) and "Remember playback position"(Bookmarkable). Shufflable means that on the rare times that you want to listen to music and you have the shuffle set on - then you might get one of your podcasts. Bookmarkable refers to the ability for you to stop a podcast mid way, do something else then return to that podcast where you left off.

iTunes allows you to select a bunch of tracks and change all their settings in one go (Right Click or Ctrl+Click), as the dialogue shows (reproduced above), but you don't get to change the key "Skip when shuffling" and "Remember playback position" settings (and a bunch of others). Fortunately you can script this easily enough and even have the option show up on the iTunes menu bar under the nifty little scripts icon if you save the AppleScript in the appropriate library folder ($HOME/Library/iTunes/Scripts).

Select the tracks, then run the script (either by running the script below in the AppleScript editor or straight from within iTunes if you saved the script in the right folder).
tell application "iTunes"
if selection is not {} then
repeat with this_track in selection
try
set shufflable of this_track to false
set bookmarkable of this_track to true
end try
end repeat
end if
display dialog "Selected tracks: skip when shuffling & remember playback position active." buttons {"OK"}
end tell
Yes, this is all relatively easy stuff, but someone may find this useful and also be inspired to investigate AppleScript a little more.

1 comment:

Anonymous said...

yes, very useful. I was going to write this for my own use but found it Googling. Thanks.