13.1 The AppleScripted iPod

 < Day Day Up > 

AppleScript is a simple programming language that lets Mac fans write mini programs to perform certain tasks . For instance, you could rig AppleScript to make iTunes play "We Will Rock You" at 8:03 every morning. Or you could use an AppleScript to send an email every three hours to your co-workers telling them how many shopping days are left until Christmas.

There are plenty of frivolous uses for AppleScript, too.

13.1.1 Installing the Script Menu

Mac OS X comes with a handful of ready-made AppleScript programs (called scripts ), including one that checks the current temperature in your Zip code and one that lets you count messages in all your mailboxes.

Most Mac fans never even know they exist, because these scripts are buried in the Application AppleScript ExampleScripts folder. Fortunately, theyre also listed in something called the Script menu, an icon on your menu bar that puts the scripts at your fingertips. To install the Script menu, open your Applications AppleScript folder, and double-click the folder icon called Script Menu (see Figure 13-1).

Figure 13-1. The Script menu, which looks like a little scroll at the right end of the Mac's menu bar, lists dozens of useful AppleScript mini programs. Why perform five or six steps when all you have to do is find and run a script designed to automate the task?
figs/13fig01.gif

13.1.2 Apple's iPod Scripts

If you want to maximize the potential of the Notes feature (Section 9.2), Apple has a collection of scripts just for you. You can download the collection at http://www.apple.com/applescript/ipod. (These scripts work with Mac OS X 10.2 and later.)

Install them by dragging the downloaded folder (called iPod) into your Home )Library Scripts folder. Magically, they now appear in your Script menu, as shown in Figure 13-1.

Here are the names of the iPod scripts in the collection and the actions they perform:

  • Clear All Notes . If you've read all the notes on your iPod and want to dump them all at once, use this command to delete all the files in the iPod's Notes folder. You have the option to trash any subfolders within the Notes folder as well.

  • Clipboard to Note . Whenever your work brings you to a scrap of information you think would be handy to have on your iPoddriving directions, a recipe, a news story, a detailed email messagehighlight it, copy it to the Mac's clipboard by pressing figs/flower.gif -C, and then choose iPod Clipboard to Note from your Script menu. In one fell swoop, the script creates a note on the iPod.

    NOTE

    If the text is longer than about 4,000 characters , the script chops it up into multiple linked files on the iPod.

  • Eject iPod . Run the Eject iPod script to safely unmount the iPod (Section 11.5). It's just an alternative to dragging the iPod icon to the Trash.

  • List Notes . This script shows you a list of all Notes files currently stored on the connected iPod. If you want to revise a note, select it from the list that appears and open it for editing.

  • Note from Web page . Web pages often contain interesting articles that you want to read later or save for future reference. As long as you're using Apple's own Safari browser, you can grab the text from an open Web page and turn it into an iPod Note just by using this script.

    To copy the article or text to your iPod, visit the "printer friendly" version of the page (which ditches all the ads, blinking banners, Flash files, and other ornaments), if one is offered . Then, from the Script menu, choose iPod Note from Webpage Printer Friendly. Another script in the same folder called MacCentral does the same thing with an article youre viewing on the MacCentral.com Web site.

13.1.3 Doug's AppleScripts

Doug's AppleScripts for iTunes has a Wal-Mart sized inventory of AppleScripts for Mac music adventures including a section devoted to iPod- related scripts. New scripts appear here frequently, so it's a good site to look in on every so often.

Many of the scripts automate the transfer or deleting of songs between iPod and Mac. For example, the collection called Four iPod Scripts (which actually contains five scripts and seems to be designed for people who have far too much music to fit on their iPods) contains AppleScripts like these:

  • Random Albums to iPod, Random Artist to iPod, and Random iPod deletes the iPod's songs and playlists, then randomly adds albums, artist repertoires , or tracks from the iTunes Library to the iPod until it's full.

  • Clean iPod deletes all songs and playlists on the iPod.

A script called Rip to iPod v1.0, for Mac OS 9 and X, tells iTunes to rip the checkmarked songs from a CD, copy them to the iPod, and then delete the tracks from the iTunes library. You skip the part about saving the audio files on your hard drive first, which can save some disk space. (Just make sure that your iPod isn't set to autosync.)

You'll find a link to the iPod scripts at http://www.missingmanuals.com. They're worth a look by anybody who loves making the Mac do stuff on its own. (The same author has created a library of iTunes-related AppleScripts; see http://www.malcolmadams.com/itunes.)

 < Day Day Up > 


iPod & iTunes. The Missing Manual
iPod: The Missing Manual (Missing Manuals)
ISBN: 1449390471
EAN: 2147483647
Year: 2004
Pages: 171
Authors: Biersdorfer

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net