This chapter introduces scripting for the desktop, or common user applications and the desktop environment. It describes how to script such tasks as playing music, controlling word processors, and the like. Special focus is given to Mac OS X and its unique Apple Open Scripting Architecture, or OSA, that enables the shell environment to interact with applications such as Photoshop or Microsoft Word. While you can do a lot with just the operating system, at some point you're going to want to start gluing various applications together. If you think about it, that's what shell scripting is: gluing applications together. However, it's not limited to things such as sed, awk, and other traditional Unix applications. You can even glue design applications and music applications together with scripting, shell and otherwise.
While part of this chapter focuses on Mac OS X and linking the shell to AppleScript, the basic concepts apply to any application. For example, OpenOffice contains an extensive scripting implementation that is syntactically very similar to Microsoft's Visual Basic for Applications (VBA). Microsoft Word on the Mac has a full VBA implementation that can be called from AppleScript, which can be called from the shell environment. In other words, regardless of which language an application uses, if it runs on some form of Unix, you can probably get to it from the shell.
This chapter covers scripting for the desktop, including the following:
□ Scripting office applications, such as the AbiWord word processors and the OpenOffice.org office suite
□ Scripting Mac OS X applications using AppleScript to drive OSA-enabled applications
□ Scripting audio players and video players
□ Tips on scripting other desktop applications
Was this article helpful?