Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

CHAPTER 21: Scripting Apple Applications 673 action. You can then save this action as a workflow and use the execute command to trigger it from your AppleScripts whenever you need this action replayed. Summary In this chapter, you continued your exploration of popular scriptable applications included in Mac OS X. You've covered a lot of ground in this chapter, so let's spend a bit of time reviewing what you've learned. Starting with iTunes, you familiarized yourself with the main classes of objects that make up the application object model--sources, tracks, and playlists--and the various commands you can use to manipulate those objects, including the standard get, set, make, duplicate, and delete commands found in most applications, as well as the add and search commands that are specific to iTunes scripting. You saw how iTunes commands like to return by-ID references to tracks and playlists, providing your scripts with a reliable way to identify the same objects later on, even if their indexes or names change. You also discovered some of the features and quirks particular to iTunes scripting, including the ability to omit parts of the references to track objects in the main library playlist, and the use of duplicate and delete to add and remove items to and from user playlists (other applications usually use add and remove commands