dougscripts.com

AppleScript

September 16 2009 - 9:58 am

UPDATED: CDDB Safari Kit v3.1

These two AppleScripts, "CDDB Safari" and "CDDB Tracks to iTunes via Safari", assist in finding and retrieving Album track information, Album, Artist, and Year from Gracenote's CDDB website using Apple's Safari browser. CDDB Safari Kit v3.1 addresses some minor changes in Gracenote's page formatting.

September 16 2009 - 8:51 am

Get Current Track from iTunes LP

When you're playing an iTunes LP the Command-L shortcut to reveal/select the track in iTunes doesn't work. Unless.

Place the iTunes LP "booklet" in its own playlist (select it and press Shift-Command-N) and open that playlist in its own window by double-clicking the name of the playlist (or choose "Open in New Window" by Control-clicking the playlist name). Double-click the booklet to open the iTunes LP in the playlist window just opened. Now you have access to the main iTunes browser while the iTunes LP stuff is playing in the separate window.

This script will emulate the Command-L shortcut providing the iTunes LP is in a separate window:

tell application "iTunes"
	if player state is stopped then return
	set pID to (get current track's persistent ID)
	set mLib to (some playlist whose special kind is Music)
	reveal (some track of mLib whose persistent ID is pID)
end tell


September 11 2009 - 9:17 am

Need More Sharing From Home Sharing?

If you find the new iTunes 9 feature "Home Sharing" a bit lacking then you may be interested in this remote management compendium I put together a few months ago. If you're ready to really get your hands dirty with things like ssh, rsync, launchd, and more, you can design a system to copy/backup/add any iTunes files to other iTunes apps on your network in the background.

September 10 2009 - 9:16 pm

UPDATED: Art to Desktop v2.1

This Stay-Open applet will continuously update your desktop picture to the album artwork of the currently playing track. Art to Desktop v2.1 is just spruced up to work better with Snow Leopard, other minor enhancements.

September 10 2009 - 7:49 pm

Dead Tracks a Problem for Genius?

There are one or two discussions going on at the Apple Discussions boards about users being unable to properly update Genius in iTunes 9, which apparently prevents Genius Mixes from kicking in. Or something. Some posters have gotten fruitful results after eliminating any dead tracks with Super Remove Dead Tracks.

Download and install the script. Turn Genius off. Run the script. Turn Genius back on.

September 10 2009 - 12:12 pm

Smart Playlists Are Not 'Scriptable

Getting an avalanche of email informing me that Smart Playlists in iTunes 9 can use boolean-like operators when defining criteria. While that's great and all, Smart Playlists cannot be constructed with AppleScript so it has zero impact on scripting.

September 10 2009 - 9:27 am

UPDATED: Save Album Art to Album Folder v2.0

Save Album Art to Album Folder v2.0 is a collection of two scripts that will assist with exporting Album artwork to a track's parent folder, presumably the track's "Album" folder.

  • "Save Album Art to Album Folder" will export the artwork of the selected tracks or tracks in the selected playlist as a graphics file to the folder which contains each selected track's file--or a specific user-selected folder.
  • "Save Track Art to Album Folder" exports the artwork of the single selected track to its parent folder, replacing any previous version.

Read Me explains much more, including modifications you can easily make.

Universal binary for OS 10.5 and better only.

This latest version updates syntax for compatibility with Snow Leopard, streamlines some code, provides new bundled progress indicator app.

September 6 2009 - 8:21 pm

Target QuickTime Player by application id

If you've got a script that needs to target QuickTime Player in Snow Leopard you probably really want to target "QuickTime Player 7". Otherwise, if you target "QuickTime Player" the QuickTime Player X app will run and it doesn't have the AppleScript Goodness like QTP7. However, if the script also has to run in Leopard, you have to target "QuickTime Player"--without the "7". But you don't need to write two scripts.

In OS 10.5 and later you can target an app by its application id. I remember seeing that in the AppleScript Release Notes for 10.5 thinking "Hmm. Now how can I use that" and never really thought of anything. Until I needed to access QTP in both 10.5 and 10.6.

This tell block:

tell application id "com.apple.quicktimeplayer"
	-- do something in QuickTime Player
end tell


...will target "QuickTime Player" in OS 10.5 and "QuickTime Player 7" in OS 10.6. The application id is the same for each, so it makes no difference what their names are. And the AppleScript architecture is virtually the same in both operating systems. (Remember that "QuickTime Player 7" is an optional install either during installation or from the "Optional Installs" folder on your installation disc.)

"QuickTime Player X" is a drastically different version of the player app and scripts written for QTP7 will not play well with it. However, it is scriptable to a modest extent. Its application id is "com.apple.QuickTimePlayerX" in case you need to target QTPX specifically.

September 2 2009 - 10:55 am

UPDATED: Lyrics via LyricWiki v2.1

Lyrics Via LyricWiki v2.1 addresses some changes in LyricWiki page formatting.

August 28 2009 - 2:56 pm

Updated a Handful

Nothing to do with Snow Leopard--what a relief, eh? I've updated seven scripts today:

These seem to be the most popular scripts that are affected by the "none/all" issue introduced in iTunes 8.2. There may be a few others, but I haven't gotten email feedback on those nor have I run across a problem with any other scripts I use regularly. But if you ever get a error like this:

...then let me know.

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.