<HTML><FONT FACE=arial,helvetica><FONT COLOR="#000000" FACE="Geneva" FAMILY="SANSSERIF" SIZE="2">Sarah - - - thanks so much for this script.   I've hit one stumbling block that's keeping it from running, and no one seems to know how to fix it - - - 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 putting <BR>
<BR>
if (class of configuration i of config) as string is (TCPIP v4 configuration)<BR>
<BR>
might fix the problem, but that gave me a syntax error.   I've only been scripting for about 2 months.   Would anyone happen to know how to solve such type-matching errors?   The impression I get is that you can't compare a 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>
<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"><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 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 ≠ "DHCP" then<BR>
            begin transaction<BR>
            set protec to get protection of configuration method of cfg<BR>
            if protec = 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.<BR>
<BR>
Sarah<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>