Apple 3 Personal Computer User Manual


 
158 Chapter 8 Administering Client Computers
This entry tells you what the verb can act on and how. This entry says that Remote
Desktop can add a specified computer to a computer list. The objects “computer” and
“computer list” are being acted upon by “add.”
To access the full AppleScript dictionary for Remote Desktop:
1 Launch Script Editor in the /Applications/AppleScript/ folder.
2 Select File > Open Dictionary.
3 Choose Remote Desktop.
4 Click Open.
The AppleScript Dictionary for Remote Desktop is also available in Appendix C,
“AppleScript Remote Desktop Suite.”
Sample AppleScript
This AppleScript is one that could be used to do a quick cleanup of a group of
computers. First, it locks the computer screens to prevent interference. Second, it
deletes all items left on the currently active desktops of the client computers. Finally, it
finishes by emptying the clients’ trash and unlocking the screens.
This script is for educational use only and no warranty is explicit or implied as to the
suitability of this script for your computing environment. Additionally, this sample
script deletes items on the target computers. Use at your own risk.
-- Start commanding the local copy of Remote Desktop
tell application "Remote Desktop"
-- decide which list to perform this on, in this case it's called
"Classroom"
set these_computers to computer list "Classroom"
-- decide what locked screen text you want displayed
set screen_message to "Please wait" as Unicode text
-- make a UNIX script which executes an AppleScript on the remote
computers
set the UNIX_script to "osascript -e 'tell application \"Finder\" to
delete every item of the desktop whose class is not disk'"
-- set the lock task parameters
set lock_task to make new lock screen task with properties {name:”Lock
Classroom”, message:screen_message}
-- perform the task
execute lock_task on these_computers
-- set the UNIX script parameters
set clean_task to make new send unix command task with properties
{name:”Clean Desktop”, showing output:false, script:UNIX_script}