Scripting TCP/IP
Scripting TCP/IP
- Subject: Scripting TCP/IP
- From: Craig Nansen <email@hidden>
- Date: Sun, 7 Oct 2001 09:49:51 -0500
I am quite new to AppleScript, but have been trying to search the
archives and follow some of the discussions to pick up ideas that can
help save us time.
In our school district we have around 3,000 computers, mainly Macs,
on a network connecting over 20 buildings.
Due to some changes in our network, we need to change settings in
TCP/IP (domain addresses and names) and we need to set TCP/IP to
always be on. An AppleScript that can do this for us will save a lot
of time.
I found the script in the AppleScript Guidebook: (We actually need to
set it to false, but I wanted to post the exact script as I found it.)
set transaction_ID to ""
try
tell application "Network Setup Scripting"
open database
set transaction_ID to begin transaction
set loads on demand of transport options "TCP/IP Globals" to true
end transaction
close database
end tell
on error error_message
try
tell application "Network Setup Scripting"
if the transaction_ID is not "" then abort transaction
close database
end tell
end try
end try
but this produces an error when compiling:
"An on can't go after this identifier"
This comes from the "set loads on demand" statement.
Yet in the explanation in the AppleScript Guidebook there is a
paragraph on "Loads on Demand"
The loads on demand property relates to the checkbox in the TCP/IP
options dialog accessed by clicking the Options button in the TCP/IP
Configurations Window. This parameter controls whether TCP/IP stays
open or is loaded only when needed.