No subject
Fri Nov 19 08:05:59 EST 2021
working database that is being opened up, that contains different networking=
settings. The script appears to go through the list in the database=20=
until it finds the active setting, and attempts to modify it to "Use DHCP" -=
- is that the correct description of what's going on?<BR>
<BR>
If this script is designed to run on OS X - - - can anyone shed light on how=
different the OS 9 version would be?<BR>
<BR>
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.<BR>
<BR>
- Rob<BR>
<BR>
In a message dated 10/11/02 9:01:45 PM, kray at sonsothunder.com writes:<BR>
<BR>
<BR>
<BLOCKQUOTE CITE STYLE=3D"BORDER-LEFT: #0000ff 2px solid; MARGIN-LEFT: 5px;=20=
MARGIN-RIGHT: 0px; PADDING-LEFT: 5px" TYPE=3D"CITE"></FONT><FONT COLOR=3D"#0=
00000" FACE=3D"Geneva" FAMILY=3D"SANSSERIF" SIZE=3D"2">Rob,<BR>
<BR>
What version of AppleScript/Mac OS are you using? It is possible that this<B=
R>
configuration didn't work properly in earlier versions...<BR>
<BR>
The reason I say that is that since I was the original poster of the<BR>
AppleScript (to which Sarah added her valuable additions), and it worked for=
<BR>
me on an iMac running OS 10.1...<BR>
<BR>
Let us know,<BR>
<BR>
Ken Ray<BR>
Sons of Thunder Software<BR>
Email: kray at sonsothunder.com<BR>
Web Site: http://www.sonsothunder.com/<BR>
<BR>
----- Original Message -----<BR>
From: <RGould8 at aol.com><BR>
To: <use-revolution at lists.runrev.com><BR>
Sent: Friday, October 11, 2002 5:53 PM<BR>
Subject: Re: Anyone know how to prevent this type mismatch error?<BR>
<BR>
<BR>
Sarah - - - thanks so much for this script.=C2=A0=C2=A0 I've hit one stumbli=
ng block<BR>
that's keeping it from running, and no one seems to know how to fix it - - -=
<BR>
was wondering if someone on this list might:<BR>
<BR>
The problem is with this line:<BR>
<BR>
if (class of configuration i of config) is (TCPIP v4 configuration)<BR>
<BR>
appleScript is complaining of a type mismatch problem.=C2=A0=C2=A0 I thought=
perhaps<BR>
putting<BR>
<BR>
if (class of configuration i of config) as string is (TCPIP v4<BR>
configuration)<BR>
<BR>
might fix the problem, but that gave me a syntax error.=C2=A0=C2=A0 I've onl=
y been<BR>
scripting for about 2 months.=C2=A0=C2=A0 Would anyone happen to know how to=
solve<BR>
such<BR>
type-matching errors?=C2=A0=C2=A0 The impression I get is that you can't com=
pare a<BR>
string to a class.<BR>
<BR>
- Rob<BR>
<BR>
In a message dated 10/2/02 7:08:18 PM, sarahr at genesearch.com.au writes:<BR>
<BR>
><BR>
> Hi Rob,<BR>
><BR>
> Here is Ken's script with an added section that changes the relevant<BR=
>
> setting to DHCP. As Ken mentioned, this just handles the first TCP<BR>
> configuration it finds, so you might need to add a check for other<BR>
> configs, but it should get you started:<BR>
><BR>
> set configMethod to ""<BR>
> set configName to ""<BR>
> set cfg to ""<BR>
><BR>
> tell application "Network Setup Scripting"<BR>
> open database<BR>
> set config to current configuration set<BR>
> repeat with i from 1 to count of configuration of config<BR>
> if (class of configuration i of config) is (TCPIP v4 configuration)<BR>
> then<BR>
> set cfg to configuration i of config<BR>
> set configName to name of config -- so you can check the name<BR>
> to see<BR>
> if it's the right one<BR>
> exit repeat<BR>
> end if<BR>
> end repeat<BR>
> set configMethod to configuration method of cfg<BR>
><BR>
> try<BR>
> if configMethod =E2=89=A0 "DHCP" then<BR>
> begin transaction<BR>
> set protec to get protection of configuration method of cfg<BR>
> if protec =3D locked then return "Setting is locked"<BR>
> set the configuration method of cfg to DHCP<BR>
> end transaction<BR>
> end if<BR>
> on error errMsg number errNum<BR>
> close database<BR>
> return "Error: " & errMsg & " " & errNum<BR>
> end try<BR>
><BR>
> close database<BR>
> return "Setting changed to DHCP"<BR>
> end tell<BR>
><BR>
> Note: there is a line above that uses the Mac's Not-equal sign<BR>
> (option-equal): if configMethod **not-equal** "DHCP" then<BR>
> It may not translate via email. Also beware of long lines wrapping. If<=
BR>
> you want me to send you the actual script, send me an email off-list.<B=
R>
><BR>
> Sarah<BR>
><BR>
> _______________________________________________<BR>
> use-revolution mailing list<BR>
> use-revolution at lists.runrev.com<BR>
> http://lists.runrev.com/mailman/listinfo/use-revolution<BR>
><BR>
><BR>
<BR>
<BR>
_______________________________________________<BR>
use-revolution mailing list<BR>
use-revolution at lists.runrev.com<BR>
http://lists.runrev.com/mailman/listinfo/use-revolution<BR>
<BR>
</BLOCKQUOTE></FONT><FONT COLOR=3D"#000000" FACE=3D"Geneva" FAMILY=3D"SANSSE=
RIF" SIZE=3D"2"><BR>
<BR>
</FONT><FONT COLOR=3D"#000000" FACE=3D"Geneva" FAMILY=3D"SANSSERIF" SIZE=3D"=
2"></FONT></HTML>
--part1_9c.27bb00b2.2ada01ce_boundary--
More information about the use-livecode
mailing list