<HTML><FONT FACE=arial,helvetica><FONT COLOR="#000000" FACE="Geneva" FAMILY="SANSSERIF" SIZE="2">Ahhh - - - perhaps that's the problem.&nbsp;  I was looking for an Applescript solution in OS 8/9 that would set the user's networking to DHCP.&nbsp;  So, if this was designed to run in 10, then that sheds some light on the issue.<BR>
<BR>
In the long-run, I'll need to do this on both Mac OS 9 _and_ Mac OS X.&nbsp;  I was assuming that the technique would be radically different, with OS X relying on more unix-calls.&nbsp;  Resources on the web that detail how to script the networking control pane are few and far between, it seems.<BR>
<BR>
>From what I gather from the script, it appears that there's some sort of networking database that is being opened up, that contains different networking settings.&nbsp;  The script appears to go through the list in the database 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 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@sonsothunder.com writes:<BR>
<BR>
<BR>
<BLOCKQUOTE CITE STYLE="BORDER-LEFT: #0000ff 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px" TYPE="CITE"></FONT><FONT COLOR="#000000" FACE="Geneva" FAMILY="SANSSERIF" SIZE="2">Rob,<BR>
<BR>
What version of AppleScript/Mac OS are you using? It is possible that this<BR>
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@sonsothunder.com<BR>
Web Site: http://www.sonsothunder.com/<BR>
<BR>
----- Original Message -----<BR>
From: &lt;RGould8@aol.com&gt;<BR>
To: &lt;use-revolution@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.   I've hit one stumbling 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.   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.   I've only been<BR>
scripting for about 2 months.   Would anyone happen to know how to solve<BR>
such<BR>
type-matching errors?   The impression I get is that you can't compare a<BR>
string to a class.<BR>
<BR>
- Rob<BR>
<BR>
In a message dated 10/2/02 7:08:18 PM, sarahr@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 \u2260 "DHCP" then<BR>
&gt; begin transaction<BR>
&gt; set protec to get protection of configuration method of cfg<BR>
&gt; if protec = 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.<BR>
&gt;<BR>
&gt; Sarah<BR>
&gt;<BR>
&gt; _______________________________________________<BR>
&gt; use-revolution mailing list<BR>
&gt; use-revolution@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@lists.runrev.com<BR>
http://lists.runrev.com/mailman/listinfo/use-revolution<BR>
<BR>
</BLOCKQUOTE></FONT><FONT COLOR="#000000" FACE="Geneva" FAMILY="SANSSERIF" SIZE="2"><BR>
<BR>
</FONT><FONT COLOR="#000000" FACE="Geneva" FAMILY="SANSSERIF" SIZE="2"></FONT></HTML>