Raw codes for Network Setup Scripting calls
Raw codes for Network Setup Scripting calls
- Subject: Raw codes for Network Setup Scripting calls
- From: email@hidden
- Date: Sun, 22 Dec 2002 16:23:33 EST
I've got the below Applescript which sets the user's TCP/IP settings to
"DHCP". This script works great, except on those OS 8.5, 8.6 systems where it
displays the "WHERE IS" dialog. This script needs to run on end-user systems
as part of an installer, so I need it to run without pestering the user. From
what I gather from previous posts, the solution is to use SMILE and get the
"raw codes" for the custom dictionary items that are specific to Network
Setup Scripting. Unfortunately, I'm not having luck finding any raw event
codes for any commands, other than "open database", below. Don't I need to
have raw codes for the "if (class of configuration i of config) is (TCPIP v4
configuration)" lines, etc? I did a "copy translate" in SMILE, which I've
used before to find raw codes - - - it just doesn't seem to yield the same
results this time around...
set configMethod to ""
set configName to ""
set cfg to ""
set config to ""
tell application "Network Setup Scripting"
open database
set config to current configuration set
repeat with i from 1 to count of configuration of config
try
if (class of configuration i of config) is (TCPIP v4
configuration) then
set cfg to configuration i of config
set configName to name of config
exit repeat
end if
end try
end repeat
set configMethod to configuration method of cfg
try
if configMethod != "DHCP" then
begin transaction
set protec to get protection of configuration method of cfg
if protec = locked then return "Setting is locked"
set the configuration method of cfg to DHCP
end transaction
end if
on error errMsg number errNum
close database
return "Error: " & errMsg & " " & errNum
end try
close database
return "Setting changed to DHCP"
end tell
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.