December 20 '13 - 10:47 am
UPDATED: File Renamer v2.4

File Renamer will rename the files of the selected tracks (or the files of the tracks in the selected playlist) with a filename pattern that is formulated using the tracks’ tag data. Optionally, export a copy of the files to a chosen location and rename the files in that location.

This latest version supports literal bracket characters (ie: [ and ]) and provides a [play order] pattern “field” which will match the index of each selected track in its sorted order.

More information and download is here.

December 14 '13 - 1:36 pm
UPDATED: PDF Adder v4.2

PDF Adder is a collection of two scripts (it used to be three) that assist with adding PDF files to iTunes as “digital booklet” PDF tracks. Each provides a method for easily supplying Author (artist), Album, Category (genre), Year, Rating and Description tag data which is then applied to the newly-added PDF track entry:

  • Add as PDF to iTunes is a PDF Service workflow that, when installed, will be available in the PDF pop-up menu of the Print Dialog. It allows you to save the current document as a PDF file (from any application that uses the Print Dialog) and add it to iTunes.
  • PDF Adder is an applet/droplet that will let you choose or drag-and-drop an existing PDF file and add it to iTunes. It can be installed in iTunes’ Scripts folder for easy access from iTunes Script menu.

Each script displays a panel like this so you can provide tag data for the PDF:

Anything you can print, you can export as a PDF…and any PDF can be added to iTunes.

These latest versions are updated for compatibility with OS X 10.9. I also got rid of PDF Dropper and just made PDF Adder launch via double-click (or Script menu launch) or by drag-and-drop. Finally, Add as PDF to iTunes will use applicable tag data for the PDF metadata tags Title, Author, Keywords (Category/Genre tag) and Subject (Description tag).

I almost included an option to add PDFs to iBooks (see below, “iBooks is Not Scriptable. Much.“) but iBooks ignores PDF metadata except for Author and of course prevents “tag” editing in the app itself. You can drag PDFs from iTunes to iBooks and the name and artist/author tags will be copied to Title and Author correctly, but that’s insufficient for me. I prefer the bevy of tags available for PDF tracks in iTunes.

Deal-breaker for some: under Mavericks, with iBooks installed, PDFs added to iTunes are put in the Music library. Under earlier OS’s, iTunes puts them in Books or Audiobooks.

More information and download here.

December 13 '13 - 1:10 pm
Search iTunes Store via Google

Kirk had a tip about using Google to search the iTunes Store in his Macworld column today. Here’s a script for that:

try

set searchText to text returned of (display dialog “Search the iTunes Music Store for:” default answer “”)

tell application “Finder” to open location “http://www.google.com/search?q=site:itunes.apple.com ” & searchText

end try

Launch and enter some search text and click the “OK” button. A new window with Google results will be displayed by your default browser.

December 11 '13 - 11:24 am
iBooks is Not Scriptable. Much.

iBooks is built without AppleScript support so I’m still using iTunes to manage my PDFs. But if you need to programmatically add a file—like a PDF—to iBooks you can use this trick, where filePath is an alias:

using terms from application “iTunes”

tell application “iBooks” to open filePath

end using terms from

Unfortunately, you can’t edit the tags in iBooks. Nor does iBooks seem to use any existing PDF metadata except “Author”. Strangely, in fact, it uses the PDF’s file name (without extension) for “Title” instead of checking the PDF’s metadata for “Title”. And while I’m making wishes, “Keyword” metadata could be parsed for a Category and perhaps a way could be found to use the PDF “Subject” metadata as a description tag somewhere.

iBooks, which seems to me to be a pretty basic database manager, stores much more metadata for other types of books (have a look at ~/Library/Containers/com.apple.BKAgentService/Data/Documents/iBooks/Books and the Books.plist there) so it doesn’t seem like it would be much of a bother to accommodate PDFs a little better.

November 29 '13 - 12:12 pm
UPDATED: Copy Tracks to Multiple Playlists v2.2

Copy Tracks to Multiple Playlists v2.2 will copy the selected iTunes tracks to one or more chosen playlists.

This latest version makes some tweaks for compatibility with OS X 10.9.

More info and download here.

November 6 '13 - 10:07 am
iTunes 11.1.3 Released

Last night, Apple released iTunes 11.1.3 which fixes some issues with the Equlaizer and switchiong views in large libraries (what’s a “large” library?) and other minor bugs. Available via software update, the App Store app, or directly download from Apple’s website.

November 6 '13 - 8:18 am
Add Files in Reverse, Sort by Date Added

A Correspondent writes that he sorts his Music library playlist by Date Added and meticulously adds each new album’s worth of files to iTunes in reverse order—one file at a time—so that an album will appear in order (well, the order established for them in the Finder); older tracks appear sorted lower in the Music library playlist than newer tracks. Get me?

Predictably, Our Correspondent is dismayed by the drudgery of this method and inquires if AppleScript can provide any relief. AppleScript provide relief from drudgery? Ahoy!

tell application “Finder”

set selectedFiles to selection

repeat with i from (length of selectedFiles) to 1 by -1

my addFile(item i of selectedFiles)

delay 1

end repeat

end tell

to addFile(aFile)

tell application “iTunes”

try

add aFile as alias

end try

end tell

end addFile

Save this as a Script Bundle—named whatever you like—to your ~/Library/Scripts/ folder. This will make the script available in the system-wide Scripts menu at the right side of the menu bar. Select the files in the Finder you want to add, which have been sorted in the order you want, and launch the script. It will add the files to iTunes in reverse order so that when they are sorted by Date Added in iTunes they appear in the order you had for them in the Finder.

UPDATE November 11, 2013: Added 1 second delay in repeat loop to prevent tracks from having the same date added (to the second) and sorting arbitrarily.

November 1 '13 - 7:15 am
That Mixed-Media Tag Edit Thing is Fixed

Via Kirk: for whatever reason, iTunes 11.1.2 removed the restriction on editing tags of tracks in a mixed-media selection.

October 30 '13 - 4:35 pm
AirPlay Scripting Bug Fixed in 11.1.2

The bug affecting AirPlay scripting has been fixed in iTunes 11.1.2.

October 28 '13 - 3:38 pm
Downloads Arriving Damaged in Mavericks

Some Correspondents using Mavericks are reporting that downloaded scripts are regarded as damaged by the OS. I suspect it is a codesigning issue. This doesn’t affect downloading to systems before OS X 10.9. I’m investigating and testing to rule out other possibilities.

UPDATE (4:15PM): Looks like this is just affecting Remove n Characters From Front or Back v4.7. Mavericks wasn’t happy with the way it was packaged. So I recompiled, rebuilt the .dmg, and re-zipped. That script should be fine now. Wish I could say I knew for certain that it’s the only one affected.

UPDATE (4:45PM): Looks like Save Album Art to Album Folder, one I posted today, is also corrupted in Mavericks. I’ve fixed it.

 
Site contents © 2001 - 2014 Doug Adams and weblished by Doug Adams, dougscripts AT mac DOT com. About.
All rights reserved. Legal.
AppleScript, iTunes, iPod, iPad, and iPhone are registered trademarks of Apple Inc.