Archive for the ‘AppleScript’ Category
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.
UPDATED: Proper English Title Capitalization v2.0
I updated Proper English Title Capitalization—for the first time in almost seven years—to version 2.0. It’s mostly a maintenance update, but I did make it run just a bit faster for Leopard or better by dumping the obsoleted “ASCII character of/number of” syntax. I also added “Show” and “Grouping” to the choice of tags to modify.
UPDATED: Lossless to AAC Workflow v2.2
If you’re one of the Correspondents who over the past couple of years have been suggesting I add AIFF-ability to Lossless to AAC Workflow, then the new v2.2 is for you.
These are two scripts that assist with importing/managing Apple Lossless or AIFF audio files and sending converted AAC copies to a mounted iPod set to “manually manage songs and videos”. Yes, iTunes 9.1+ will auto-encode tracks to iPod, but only 128kbps AAC; these scripts enable to use your Custom AAC encoder settings.
UPDATED: Import iPod Audio Files v3.0
Import iPod Audio Files copies the files of the selected iPod tracks to your iTunes Music/Media folder and then adds them to iTunes. Additionally, you can assign the new tracks to their own playlist. Requires the iPod be set to “Manually manage music and videos”.
Will not work on Windows-formatted iPods.
Not compatible with iPhone/iPod touch.
Not recommended for large-scale iPod audio recovery operations.
This latest version is a maintenance release that fixes a problem locating files and has a re-designed progress indicator.
NEW: Make Add-to-Playlist-Droplet
After posting Drop to Playlist recently, I went crazy for the droplets. This new script, Make Add-to-Playlist-Droplet, will create AppleScript droplets that perform a function similar to iTunes 9’s “Automatically Add to iTunes” folder but for individual playlists. Simply select a playlist and run the script to create a droplet that references the selected playlist. Once such a droplet is created, drag-and-dropping files to its icon in the Finder will add the files to your iTunes library and copy the new tracks directly to the playlist that the droplet references. The script will allow you to create as many droplets for as may playlists as you like.
UPDATED: Embed Artwork v2.0
I’ve updated Brian Webster’s Embed Artwork as universal binary, but otherwise there are no changes. This script simply re-embeds artwork into the files of the selected tracks. Handy for ensuring that artwork data travels with a file.
UPDATED: I Hate That iTunes Done Chime! v2.0
OK. I suppose I don’t actually hate it. But you might find it convenient to change the “done” chime that sounds whenever you import or convert files in iTunes. I Hate That iTunes Done Chime! v2.0 will let you select a new sound to replace “boodely-OOP!” — which is actually named “complete.aif”. You can choose from any of the default system sounds (ping, sosumi, submarine, and so on), no sound, or your own AIFF sound file.
This latest version is simply a maintenance release and is saved as universal binary.
NEW: Drop to Playlist
If you like the “Automatically Add to iTunes” folder that is created with iTunes 9, which allows you to drop files to it to add to iTunes, you may like Drop to Playlist. This is a droplet that will add files dropped on it to your iTunes library and then copy them to a specific user playlist that you set in the droplet’s preferences. The preference setting is accessed by double-clicking the droplet, and can be changed when required. Handy when placed in the Finder toolbar or sidebar.