AppleScript
Interesting play Issue with MiniPlayer
As I mentioned below, I had to fix a script to workaround a problem playing a playlist when only one track had as yet been copied to it, which prevented the rest of the subsequently added tracks from being recognized by MiniPlayer and Up Next; thus, only the first track would play. Similarly, if you were to play (the AppleScript command) any track in a playlist, the following tracks will not play because they haven't been recognized by MiniPlayer and Up Next ("No upcoming songs").
Doesn't go good when Mini Player is empty:
You can play the playlist and everything's OK. You just can't initiate play of the entire playlist by playing one of its tracks with AppleScript.
Goes good and loads in MiniPlayer:
Additionally, I found that if the MiniPlayer was already loaded up with tracks, playing a track (via AppleScript) from anywhere would play that track and then resume with whatever is next in MiniPlayer.
iTunes 11 Loses playlist window
Technically, you can't open a playlist in its own window in iTunes 11, so the playlist window element is moot.
iTunes 11 Loses Gapless Track Feature
You can no longer designate an album of tracks as gapless. Thus, a track's gapless property is now moot.
ERRATA: My title for this post is misleading. The gapless feature has not been lost. But the ability to manually change a track's gapless setting has been removed.
iTunes 11 Released
Apple has released iTunes 11. Apple originally previewed iTunes 11 at its September Special Event, announced a vague October release date, and then later postponed release to November.
This updated version features some iOS-inspired GUI changes, re-designed MiniPlayer, improved iCloud integration, improved search, and a revamped design of the iTunes Store.
AppleScript Save Changes in Mountain Lion
I've been meaning to post this for the record. Shane Stanley has written up How Mountain Lion Changes the Rules for AppleScript at TidBITS. He explains how scripts and AppleScript applications can be saved in an uncompiled state. If you distribute or system manage AppleScripts and develop on Mountain Lion you really should be aware of these changes.
Project: Gather Partially Played Tracks
I got an email from Correspondent Sherwood Botsford asking if there was any way to round up his partially played audiobooks. What he wanted to do was maintain a playlist of recently added audiobook tracks that he hadn't finished listening to and sync it to his iPhone. He'd gotten the recently added stuff okay by using a Smart Playlist. But Smart Playlists don't include any criteria for detecting how far along a track has been played, and Last Skipped may not necessarily have been set if a track was simply stopped rather than skipped.
If a track's "Remember playback position" setting in its Get Info's Options tab has been checkmarkedpresumably, your audiobooks are "bookmarkable" by default or you have set the "remember" option manuallya track's bookmark property will contain the number of seconds the track had been played before it was stopped. Thus, if any tracks have a bookmark value greater than zero then they've been partially played.
So here's a script that will gather all those partially played tracks into a new playlist named "Partially Played" and that playlist can be the source for the Smart Playlist:
Cocoa-AppleScript Applets/Droplets
Apple has given AppleScript Editor in Lion the ability to access Cocoa frameworks. In a nutshell, this means that AppleScript Editor can be used to create quite complex programs (which can run on Snow Leopoard and Lion only). But as far as I'm concerned, the big bonus is the ability to create single-window UIs for some of my AppleScripts. Instead of using two or three display dialogs or choose from list boxes, a single pane incorporating many options settings can be used. I've already created some of these kinds of interfaces in the form of helper apps that I bundle with a script. But now, I can make these UIs a part of the script bundle itself, without the need to launch additional helper apps. Plus: wicked fast.
Look for these sorts of scripts and updates to scripts coming soon.
Just Play This Track and Stop Redux
For years many iTunes users and Correspondents have asked about a script that can just play the selected track and stop. Various methods using timers and delays and idle handlers were thrown at the challenge but nothing worked perfectly. But then: the iTunes Team quietly added a once parameter to the iTunes play command.
tell app "iTunes" to play item 1 of selection with once
Run that on a selected track and iTunes will play it once and then stop.
You know when they added it?
In iTunes 6!
Incredulous, I went back to my original write-up on iTunes 6 from October 2005. Whack! It was the only AppleScript change I even mentioned...and then promptly forgot about. I even managed at the time to write a Missing Menu Script using it.
In any case, all of this was precipitated by a posting at Mac OS X Hints awhile back, authored by fellow AppleScripter Laine Lee, which mentions the once parameter and just-play-once-and-stop trick.
I can't believe it took five years for me to rediscover it.
iTunes 10 Breakage (Nothing Serious)
Some AppleScripts from this site use a routine that checks for the version of iTunes you are running. Some of the scripts that use these routines are broken under iTunes 10. So when running a script with iTunes 10.0 you may run into a dialog that erroneously reports something like "This script requires iTunes 6.0.2 or better". This is not a bug in iTunes, but a problem with the way the script does the version check. (Long story short: the version number once was a number, but more modern versions of apps use a string. Thus "10.0" is not necessarily greater than "9.2.1" and the routine fails to accommodate this.) You can edit/comment out the version check routine yourself or wait until I get around to fixing the handful or so scripts that are affected. In that case, let me know if you see the error.