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

Export an iTunes playlist in play order using Automator Apps
Sometimes you want to do something like create a MP3 CD, but you need to do so with several iTunes playlists, in a particular play order. However, iTunes' MP3 CD burning support is rather limited. For example, it can burn a playlist in order -- but only one big playlist. On the other hand, it can burn a CD with the MP3s sorted into artist or album folders. It can't create multiple-directory CDs for CD players that support it, limiting it to one big list. You can burn an MP3 disc (with multiple folders/playlists) from the Finder or Toast, but they will both burn the files in alphabetical order. If you are trying to burn a CD with several directories of several playlists, in a certain play order, these limitations are very frustrating.

The normal solution to this problem is to rename each file from each playlist in the finder -- such as adding a number before the track name -- so that songs are displayed in the correct order for burning. This is very slow to do manually. So, I created an Automator workflow to do the work. Make sure that before running this workflow, you select all the songs you want to be exported.

While the Rename Finder Items action is pretty well known, I had no idea that it would work with iTunes like it does to keep the order straight. Interesting!

The setup (note that these steps are listed based on having View » Arrange Actions By set to Application):
  1. Automator » Ask for Confirmation (This may be Leopard only.). This asks if the user wishes to continue, since it may take a while to run.
  2. iTunes » Get Selected iTunes Items. This will select all songs that you've selected in iTunes, such as the songs in a playlist.
  3. Finder » Copy Finder Items. This will copy the song files to the Finder. Select a default folder, such as the Desktop. Check the "Show This Action When the Workflow Runs" box under Options to allow you to choose a folder to export a particular playlist into.
  4. Finder » Rename Finder Items (Make Finder Item Names Sequential). You should say Make Sequential in the top drop-down, and then select Add number to existing item name. Select Place number before name, Start numbers at 1, separated by dash (or underscore, etc), and make all numbers X digits long. X should be 1 to 3, depending on how many songs you have -- three digits will allow you to export more than 100 songs.
  5. Save your workflow to the scripts folder, or as an application to add to your Dock.
When run, the workflow will first copy the files to the selected Finder folder, then rename them. You can then burn the folder -- and any other folders of exported playlists -- to a disc, using the Finder or Toast. Problem solved!

I also want to point that the workflow will only run on the OS that it is created with -- Tiger or Leopard. It seems that the way the Automator Actions work varies between Tiger and Leopard, so if you have two or more Macs with Tiger and Leopard, you need to recreate the workflow using Automator on the OS you want it to run on. The name of the actions, and the options that you should select are the same in both OS. Go figure.
  • Currently 3.75 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (8 votes cast)

Export an iTunes playlist in play order using Automator | 1 comments | Create New Account
Click here to return to the 'Export an iTunes playlist in play order using Automator' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Export an iTunes playlist in play order using Automator
Authored by: digidan on Apr 13, '09 07:32:51AM


I've had a couple of people contact me about this workflow, saying that it wouldn't work for some reason. On my MacBook Pro running 10.5.6 and iTunes 8.1.1, It works well. Still, there are a couple of little bigs I've found that may be the cause of some of these problems.

First, note that it seems that it can take as much as 30 seconds (or more, at times) for the automator workflow runner to start (and show the icon in the menu bar) if has not been run at least once since the last time you started up your mac - and it will take a while to copy everything. During this time, it looks like nothing is happening, making it very tempting to go back into the menu and run the workflow again needlessly. See the next point.

Second, only run one instance of the workflow at a time. If it's busy copying or starting up the automator runner (the system process that actually runs the workflow), and you run the workflow again, it will cause all sorts of errors, from copying a few songs but not others, to stopping mid-copy, to not renaming the files, to just plain freezing up.

Third, sometimes iTunes doesn't register particular songs as "selected" if you merely select the playlist name - so make sure you actually select all the song themselves within the iTunes windows (they should be bright blue). Also, keep the iTunes window active and "in front" until Automator Runner starts up.

Fourth, apparently in iTunes 8, Apple decided to force all songs to be imported with their track number in stored the file name, by removing the user option in the advanced pane of preferences. This means that many (most) songs will have a two or three digit number in the file name, even if the automator workflow did not add numbers to each file. If you're troubleshooting a workflow, it's a good thing to keep in mind.

[ Reply to This | # ]