Kirk had a tip about using Google to search the iTunes Store in his Macworld column today. Here’s a script for that:
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
Launch and enter some search text and click the “OK” button. A new window with Google results will be displayed by your default browser.
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.
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.
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.
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)
tell application “iTunes”
add aFile as alias
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.
Via Kirk: for whatever reason, iTunes 11.1.2 removed the restriction on editing tags of tracks in a mixed-media selection.
The bug affecting AirPlay scripting has been fixed in iTunes 11.1.2.
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.
Save Album Art as folder.jpg will export the artwork of the selected tracks or tracks in the selected playlist as a JPEG image file named folder.jpg to the folder which contains each selected track’s file–presumably the track’s Album folder. Many third-party music players and systems (Sonos, for example) may look for a “folder.jpg” here to use as display artwork.
Very similar to the just updated Save Album Art to Album Folder.
This latest version makes some tweaks for Mavericks compatibility.
More info and download here.
This script will export the artwork of the selected tracks, or the tracks in a selected playlist, as an image file to the folder which contains each selected track’s file—presumably the track’s Album folder—or a specific user-selected folder. If multiple album tracks are selected, the script will make sure only one artwork file per Album is exported.
This latest version fixes the problem with Mavericks and makes some minor maintenance tweaks.
More info and download is here.