AppleScripts for iMedia
Starting with version 2.1, iMedia is AppleScriptable. A collection of sample iMedia scripts can be downloaded below. Feel free to use them, tweak them or mutate them into something else.
To learn about using AppleScript with iMedia, choose iMedia Help from the iMedia Help menu, and go to Using AppleScript with iMedia.
About the Scripts
The following scripts are contained in the disk image linked above. If you want to use these scripts to learn how to script iMedia, note that they are listed here in approximately increasing complexity.
- Stream MP3 in iTunes If the currently selected item provides an MP3, this script extracts the appropriate URL and passes it to iTunes for playing. Not all audio programs are offered as streamable MP3, but this offers an alternative to RealPlayer in some cases.
- Mail Section List This script creates a new message in Apple Mail, and inserts the title, author and URL for each item in the currently selected Section List. For programs with streaming audio, the direct URL to the streaming audio is inserted.
- Open Section in OmniWeb Tabs This script creates a new browser window in OmniWeb, and opens each item in the currently selected Section List in a new OmniWeb tab. (We've used OmniWeb here because, unlike Safari, it has good AppleScript support.)
- Link To Favorites in BBEdit and Link To Favorites in TextEdit These scripts load the Favorite Authors section, and create an HTML unordered list that links to each item in the section, suitable for including in a web page or weblog. Both scripts do the same thing, one using BBEdit and the other using TextEdit.
- Download MP3 to iTunes This script finds all items in the Programs section that have a unique MP3 file, and allows you to select one or more of these for download. It then downloads each selected MP3, and adds it to your iTunes library, with the MP3 tags set appropriately. You can then sync your iPod and listen to Democracy Now! wherever you go.
Installing the Scripts
Once you download and open the disk image, you can double-click a script to open it in Script Editor, and run it from there. However, they generally run faster from the iMedia Scripts menu. Choose Open Scripts Folder from the iMedia Scripts menu, and drag the scripts into that folder. Then choose Update Scripts Menu, and you should see the scripts appear in the menu.