Integrating Automator and AppleScript
With Apple Remote Desktop 3, Apple provides more advanced automation features than ever. Included in this version are 30 Automator actions for Remote Desktop. This enables you to combine a number of common Remote Desktop tasks into Automator workflows. Taking automation even further, Apple has made almost every feature and command of Remote Desktop scriptable using AppleScript. If you are proficient in using both Automator and AppleScript, you can create a wide variety of automated tools for use in both systems administration tasks and for the use of educators, managers, and general users.
The Automator actions for Remote Desktop are installed along with the Remote Desktop administrator application. You can access and use them to build Automator workflows, as you would any other Automator actions, by launching Automator and then selecting the Remote Desktop application from the Library list. The built-in actions include several methods of finding or identifying computers or computer lists to work with—along with a number of the common Remote Desktop tasks or commands such as Copy Items, Install Packages, Eject All Disks, Empty Trash, Execute a Unix Task, Lock Screens, Restart Computers, Send Text Messages, and options for changing various System Preferences settings.
If you are familiar with Automator, you can probably already think of a number of ways to string these actions together into useful workflows. This is particularly evident if you consider that Automator workflows can be saved as workflows that run using Automator itself, as standalone applications, or as Finder plug-ins. Saving workflows as either a general Finder plug-in that is displayed in a contextual menu when you select any item in the Finder or as a folder action that is run whenever a change is detected to a folder’s contents can offer you some very interesting possibilities. One of the most obvious is creating a folder action that automatically copies items placed in a folder to specified workstations.
However, by making almost all Remote Desktop’s features scriptable and providing the Execute AppleScript action for Remote Desktop, Apple has provided an even wider variety of workflows that you can create. If you open the AppleScript library for Remote Desktop, for example, you’ll notice that you can create scripts that launch observer or control sessions, select computers based on virtually any characteristic, copy items, install packages, set the startup disk, start screen sharing, open items or applications, and perform several other tasks. By combining these features with other AppleScript capabilities and Automator actions, you can create a wide variety of ways to automate the management of Macs in a network using Remote Desktop. You can even expand on these available options by including Unix commands that trigger shell scripts.
Perhaps one of the best advantages of being able to script and automate Remote Desktop functions to this degree is the fact that you can create workflows or applications that can perform complex tasks but that can be launched and used by users who do not have as solid a technical grasp of Mac OS X or Apple Remote Desktop. For example, you could create a workflow that selects all computers in a classroom; sends a message to tell students to save their work; and then logs off any remaining students, empties the trash, and shuts down the computers. By placing saving such a workflow as an application, you could place it on the desktop of a teacher’s computer in the room. The teacher doesn’t need to be bothered even knowing how to launch and use the Remote Desktop application—he or she just needs to know enough to double-click that icon at the end of a class period or activity.
Needless to say, the Automator intuitive interface can make creating basic workflows fairly easy. However, to truly take advantage of these features, having a solid grasp of not only Automator but also AppleScript and even some form of shell scripting knowledge is needed to take automating Remote Desktop to its fullest potential. That said, even the most basic uses of its traditional automation abilities can help you manage a Mac network or office—or even a single classroom—much more easily.