Fri Nov 19 14:00:03 CST 2010
networking database that is being opened up, that contains different=20
networking settings. The script appears to go through the list in the=20
database until it finds the active setting, and attempts to modify it to "Us=
DHCP" - - is that the correct description of what's going on?
If this script is designed to run on OS X - - - can anyone shed light on how=
different the OS 9 version would be?
Thanks again for your help - - - this is indeed one of the best Listserve's=20
I've been on. Folks here are very helpful and knowledgeable.
In a message dated 10/11/02 9:01:45 PM, kray at sonsothunder.com writes:
> What version of AppleScript/Mac OS are you using? It is possible that this
> configuration didn't work properly in earlier versions...
> The reason I say that is that since I was the original poster of the
> AppleScript (to which Sarah added her valuable additions), and it worked=20
> me on an iMac running OS 10.1...
> Let us know,
> Ken Ray
> Sons of Thunder Software
> Email: kray at sonsothunder.com
> Web Site: http://www.sonsothunder.com/
> ----- Original Message -----
> From: <RGould8 at aol.com>
> To: <use-revolution at lists.runrev.com>
> Sent: Friday, October 11, 2002 5:53 PM
> Subject: Re: Anyone know how to prevent this type mismatch error?
> Sarah - - - thanks so much for this script.=C2=A0=C2=A0 I've hit one stumb=
> that's keeping it from running, and no one seems to know how to fix it - -=
> was wondering if someone on this list might:
> The problem is with this line:
> if (class of configuration i of config) is (TCPIP v4 configuration)
> appleScript is complaining of a type mismatch problem.=C2=A0=C2=A0 I thoug=
> if (class of configuration i of config) as string is (TCPIP v4
> might fix the problem, but that gave me a syntax error.=C2=A0=C2=A0 I've o=
> scripting for about 2 months.=C2=A0=C2=A0 Would anyone happen to know how=20=
> type-matching errors?=C2=A0=C2=A0 The impression I get is that you can't c=
> string to a class.
> - Rob
> In a message dated 10/2/02 7:08:18 PM, sarahr at genesearch.com.au writes:
> > Hi Rob,
> > Here is Ken's script with an added section that changes the relevant
> > setting to DHCP. As Ken mentioned, this just handles the first TCP
> > configuration it finds, so you might need to add a check for other
> > configs, but it should get you started:
> > set configMethod to ""
> > set configName to ""
> > set cfg 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
> > 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 -- so you can check the name
> > to see
> > if it's the right one
> > exit repeat
> > end if
> > end repeat
> > set configMethod to configuration method of cfg
> > try
> > if configMethod =E2=89=A0 "DHCP" then
> > begin transaction
> > set protec to get protection of configuration method of cfg
> > if protec =3D 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
> > Note: there is a line above that uses the Mac's Not-equal sign
> > (option-equal): if configMethod **not-equal** "DHCP" then
> > It may not translate via email. Also beware of long lines wrapping. If
> > you want me to send you the actual script, send me an email off-list.
> > Sarah
> > _______________________________________________
> > use-revolution mailing list
> > use-revolution at lists.runrev.com
> > http://lists.runrev.com/mailman/listinfo/use-revolution
> use-revolution mailing list
> use-revolution at lists.runrev.com
Content-Type: text/html; charset="UTF-8"
<HTML><FONT FACE=3Darial,helvetica><FONT COLOR=3D"#000000" FACE=3D"Geneva" F=
AMILY=3D"SANSSERIF" SIZE=3D"2">Ahhh - - - perhaps that's the problem. =20=
I was looking for an Applescript solution in OS 8/9 that would set the user=
's networking to DHCP. So, if this was designed to run in 10, then th=
at sheds some light on the issue.<BR>
In the long-run, I'll need to do this on both Mac OS 9 _and_ Mac OS X. =
I was assuming that the technique would be radically different, with OS X=20=
relying on more unix-calls. Resources on the web that detail how to s=
cript the networking control pane are few and far between, it seems.<BR>
More information about the use-livecode