dougscripts.com

November 6 2013 - 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 2013 - 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 2013 - 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 2013 - 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 2013 - 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.

October 28 2013 - 12:39 pm

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.

October 28 2013 - 10:32 am

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 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.

October 25 2013 - 1:56 pm

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.

October 23 2013 - 12:00 pm

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.

October 23 2013 - 7:19 am

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?

Site contents © 2001 - 2024 (that's right: 2001) Doug Adams and weblished by Doug Adams. Contact support AT dougscripts DOT com. About.
All rights reserved. Privacy.
AppleScript, iTunes, iPod, iPad, and iPhone are registered trademarks of Apple Inc. This site has no direct affiliation with Apple, Inc.
The one who says "it cannot be done" should not be interrupting the one who is doing it.