No subject


Sun Oct 8 04:49:45 CDT 2006


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.&nbsp;  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: &lt;RGould8 at aol.com&gt;<BR>
To: &lt;use-revolution at lists.runrev.com&gt;<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>
&gt;<BR>
&gt; Hi Rob,<BR>
&gt;<BR>
&gt; Here is Ken's script with an added section that changes the relevant<BR=
>
&gt; setting to DHCP. As Ken mentioned, this just handles the first TCP<BR>
&gt; configuration it finds, so you might need to add a check for other<BR>
&gt; configs, but it should get you started:<BR>
&gt;<BR>
&gt; set configMethod to ""<BR>
&gt; set configName to ""<BR>
&gt; set cfg to ""<BR>
&gt;<BR>
&gt; tell application "Network Setup Scripting"<BR>
&gt; open database<BR>
&gt; set config to current configuration set<BR>
&gt; repeat with i from 1 to count of configuration of config<BR>
&gt; if (class of configuration i of config) is (TCPIP v4 configuration)<BR>
&gt; then<BR>
&gt; set cfg to configuration i of config<BR>
&gt; set configName to name of config -- so you can check the name<BR>
&gt; to see<BR>
&gt; if it's the right one<BR>
&gt; exit repeat<BR>
&gt; end if<BR>
&gt; end repeat<BR>
&gt; set configMethod to configuration method of cfg<BR>
&gt;<BR>
&gt; try<BR>
&gt; if configMethod =E2=89=A0 "DHCP" then<BR>
&gt; begin transaction<BR>
&gt; set protec to get protection of configuration method of cfg<BR>
&gt; if protec =3D locked then return "Setting is locked"<BR>
&gt; set the configuration method of cfg to DHCP<BR>
&gt; end transaction<BR>
&gt; end if<BR>
&gt; on error errMsg number errNum<BR>
&gt; close database<BR>
&gt; return "Error: " &amp; errMsg &amp; " " &amp; errNum<BR>
&gt; end try<BR>
&gt;<BR>
&gt; close database<BR>
&gt; return "Setting changed to DHCP"<BR>
&gt; end tell<BR>
&gt;<BR>
&gt; Note: there is a line above that uses the Mac's Not-equal sign<BR>
&gt; (option-equal): if configMethod **not-equal** "DHCP" then<BR>
&gt; It may not translate via email. Also beware of long lines wrapping. If<=
BR>
&gt; you want me to send you the actual script, send me an email off-list.<B=
R>
&gt;<BR>
&gt; Sarah<BR>
&gt;<BR>
&gt; _______________________________________________<BR>
&gt; use-revolution mailing list<BR>
&gt; use-revolution at lists.runrev.com<BR>
&gt; http://lists.runrev.com/mailman/listinfo/use-revolution<BR>
&gt;<BR>
&gt;<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-revolution mailing list