146 Chapter 8 Administering Client Computers
To copy and execute a script:
1 Prepare and save your script.
Make sure your script is saved as plain text with UNIX line breaks.
2 Open Remote Desktop.
3 Select a computer list in the Remote Desktop window.
4 Select one or more computers in the selected computer list.
5 Use the Copy Items command to copy your script to the client computers.
See “Copy Options” on page 107 and “Copying from Administrator to Clients” on
page 108 for more information.
6 After copying the script, choose Manage > Send UNIX Command.
7 Execute the script by typing:
sh script pathname
8 Click Send.
Executing AppleScripts with Remote Desktop
AppleScripts can be executed on client computers in two ways. They can be saved and
executed as an application, or sent at once using the command line.
To learn more about AppleScript, see AppleScript Help in Help Viewer or go to:
www.apple.com/applescript/.
To send and execute an AppleScript:
1 Save the AppleScript as an application.
2 Open Remote Desktop.
3 Select a computer list in the Remote Desktop window.
4 Select one or more computers in the selected computer list.
5 Use the Copy Items command with the Open Items option selected in the Copy Items
dialog.
See “Copy Options” on page 107 for more information.
To execute an AppleScript using the Send UNIX Command:
This method uses the osascript command. See the osascript man page for more
information.
1 Select a computer list in the Remote Desktop window.
2 Select one or more computers in the selected computer list.
3 Choose Manage > Send UNIX Command.
4 Type or paste the AppleScript in the UNIX Command window, like this:
osascript -e 'First line of script' -e 'Next line of script' [ -e ... ]