Network Setup Scripting
Commands are the action verbs that you use to script Network Setup Scripting, such as open database, close database, and connect (which you use to automate a modem’s connection to the Internet). The make command, for instance, allows a script to make a new network configuration, such as a TCP/IP configuration, “on the fly.” See the example under the make command section.
This command terminates a transaction. None of the changes that the script initiated within a begin/end transaction block will be completed. See begin transaction later in this chapter.
You can use this command to add a configuration such as a TCP/IP setting to Open Transport’s configuration sets. Configuration sets are, as they sound, a group of configurations.
This identifies the
configuration set to add the
configuration to, as in:
configuration set "My Network Settings" or current configuration set
tell application "Network Setup Scripting" set tId to "" -- this var will hold the transaction ID try open database (*use this when the script is changing the open transport database; the var tId will hold the transaction id integer *) set tId to begin transaction add TCPIP v4 configuration "newMacIP" to¬ configuration set "My Network Settings" end transaction close database on error (* make sure transaction is aborted and database gets closed if there is an error *) if tId is not equal to "" then ...