Alternatively, you could use a UNIX “read standard input” redirection which looks like:

osascript <<EndOfMyScript

...insert script here...

EndOfMyScript

For example, a simple script to create a folder and set its label would be entered as:

osascript <<EndOfMyScript tell the application “Finder”

make new folder

set the name of the result to “New Folder”

set the label index of folder “New Folder” to 2 end tell

EndOfMyScript

5Click Send.

The client computer executes the script.

Built-in Command-Line Tools

Apple Remote Desktop includes three powerful command-line tools that can be used with Send UNIX Command: networksetup, systemsetup, and kickstart. The tools themselves are embedded within the Apple Remote Desktop client software, and do not interfere with existing installations of the software on Mac OS X Server.

The locations of two of the tools’ (networksetup and systemsetup) are added to the default shell PATH, so you can access them through Remote Desktop as if they were installed in one of the standard UNIX tool locations.

The kickstart tool is not in the default shell path. It must be activated explicitly at its location:

/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/

Resources/kickstart

Any command in the Mac OS X Server command-line guide that uses networksetup or systemsetup can be used in Remote Desktop using the Send UNIX Command task. To change any settings using these tools, you must run them with root permissions.

The command-line guide can be found at:

www.apple.com/server/documentation/

Using networksetup

The command-line tool networksetup is used to configure a client’s network settings. You can use it to create or modify network locations, change IP addresses, set network service proxies, and much more. You can find the command-line syntax, explanations, and an example in the tool’s help prompt by entering the following line in Terminal:

ÂFor Mac OS X 10.3 clients use the following:

Chapter 8 Administering Client Computers

147

Page 147
Image 147
Apple 3 manual Built-in Command-Line Tools, Using networksetup