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.
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.
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.
AirPlay Scripting Bug Fixed in 11.1.2
The bug affecting AirPlay scripting has been fixed in iTunes 11.1.2.
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.
UPDATED: Save Album Art as folder.jpg v2.5
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.
UPDATED: Save Album Art to Album Folder v4.4
Save Album Art to Album Folder is one of the handful of Artwork Managment scripts suffering from a bit of trouble running under Mavericks.
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 filepresumably the track's Album folderor 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.
Artwork Scripts and Mavericks
Some of the newer Artwork Management scripts will fail in Mavericks. They each use a routine that dumps artwork to a file which doesn't work very well under OS X 10.9:
tell me to set fileRef to (open for access pathToNewFile with write permission)
tell application id "com.apple.iTunes" to write (get raw data of artwork 1 of theTrack) to fileRef starting at 0
tell me to close access fileRef
iTunes will give up an error like this: "AppleEvents/sandbox: Returning errAEPrivilegeError/-10004 and denying dispatch of event rdwr/writ from process 'Save Album Art to Album Folder' because it is not entitled to send an AppleEvent to this process."
(Two words I didn't want to see side-by-side: "AppleEvents" and "sandbox".)
The fix is to just stuff the raw data into a variable first then write the data to the file from the variable. I'll be working this fix into all the scripts affected over the next days and weeks.
But There's Good AppleScript News, Too
While losing iWorks AppleScript support is anxiety-inducing, some great new features have been added to AppleScript in Mavericks that are pretty exciting. I've played a little with libraries and Notifications in the DPs, but haven't incorporated anything into my scripts since most a few of these features are not backwards-compatible on earlier operating systems.
Don Southard has a good article at MacStories outlining the latest stuff.
AppleScript Support Killed In Latest iWorks
Apple has effectively killed AppleScript support in its latest versions of the iWorks apps. Probably not a surprise but a shock just the same. It's not a surprise because AppleScript support in Pages.app et al has never been very glamorous. But I don't have any doubts that the main consideration is the big part the iWorks apps play in Apple's iCloud/iCloud.com stategy and the security ramifications thereof. Anything that touches iCloud is pretty much hands-off to AppleScript.
Still, it's hard to sit helpless and watch AppleScript's maddeningly sad and frustrating march to irrelevance as iOS usage inevitably overtakes OS X.
Inter-app automation on iOS. Now that would cheer me up. There's hope, right?