Audio Hijack to iTunes script

I use Audio Hijack Pro to record audio streams—mostly from BBC Radio—for later listening on my iPod. To automate the process for shows I listen to regularly, I had timers set up in Audio Hijack to record the shows when I was away from the computer and add them to my iTunes library. Audio Hijack has a built-in command for doing this, which you can choose from the Recording pane.

Until recently, iTunes would classify these recordings as audiobooks, and the “Remember playback position” and “Skip when shuffling” options would be automatically checked—and would, in fact, be dimmed so they couldn’t be unchecked.

This was exactly what I wanted, as the shows were often too long for me to listen to in one sitting. But after the recent update of iTunes to accommodate the iPhone, the shows were no longer considered audiobooks and the “Remember playback position” and “Skip when shuffling” options weren’t checked for my newly-imported shows. Going back to a show after an interruption would make the show restart from the beginning, and I’d have to spin the wheel to find where I’d left off.

Fortunately, Rogue Amoeba allows you to run your own scripts when a recording is finished, and they even give you simple iTunes importer script in the Help file (you’ll find it in the “Extending with AppleScript” subsection of the “Advanced Topics” section). I made a few small changes and got just what I needed.

 1:  on process(theArgs)
 2:     
 3:     --Coerce args to be a list
 4:     if class of theArgs is not list then
 5:         set theArgs to {theArgs}
 6:     end if
 7:     
 8:     --Into iTunes ye files shall go
 9:     tell application "iTunes"
10:         repeat with theFile in theArgs
11:             set theTrack to add theFile
12:             set shufflable of theTrack to false
13:             set bookmarkable of theTrack to true
14:         end repeat
15:     end tell
16:     
17:  end process

I named the script “Add Show to iTunes.scpt” and put it in ~/Library/Application Support/Audio Hijack Pro/Recording Scripts, a folder I had to make. It now shows up in the Scripts popup menu in Audio Hijack’s Recording pane and my timed recording are back to working the way I want.