10.4: Move MP4 films to iTunes via Automator

May 30, '06 07:30:00AM

Contributed by: phil4u2

I watch quite a few DVDs through my iPod Video on my way to and from work. I usually convert my films with Handbrake in MP4 format to the Desktop. I have iTunes set to organise my music and films automatically, which means that all files dragged into it are copied to ~/Music -> iTunes -> iTunes Music. I wanted to find a solution to avoid copying the films and have them put in my film library with Automator.

First, I found out that all my films are stored in a folder called "Unknown artist." Moving the file there before loading it in iTunes will avoid the copy process. Secondly, I found out that the iTunes Automator action for importing media into iTunes couldn't import MP4 files. I had to use an AppleScript to do that instead. So here are the steps in my Automator workflow:

  1. Finder library, Get Specified Finder Items action.
  2. Finder library, Move Finder Items action, to ~/Music/iTunes/iTunes Music/Unknown Artist/
  3. Automator library, Run AppleScript action, with the following AppleScript:
    on run {input, parameters}
      
      tell application "iTunes"
        launch
        set this_track to add input to playlist "Library" of source "Library"
        duplicate this_track to playlist "film"
      end tell
      
      return input
    end run
I then save it into ~/Library -> Workflows -> Applications -> Finder" as iTunes Film. Then all I need to do is control-click on the film on the Desktop and chose Automator > iTunes Film from the pop-up menu.

Comments (5)


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