No subject


Tue Aug 27 04:49:46 EDT 2019


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=
e=20
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=
=20
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.

- Rob

In a message dated 10/11/02 9:01:45 PM, kray at sonsothunder.com writes:


> Rob,
>=20
> What version of AppleScript/Mac OS are you using? It is possible that this
> configuration didn't work properly in earlier versions...
>=20
> 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
> for
> me on an iMac running OS 10.1...
>=20
> Let us know,
>=20
> Ken Ray
> Sons of Thunder Software
> Email: kray at sonsothunder.com
> Web Site: http://www.sonsothunder.com/
>=20
> ----- 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?
>=20
>=20
> Sarah - - - thanks so much for this script.=C2=A0=C2=A0 I've hit one stumb=
ling block
> that's keeping it from running, and no one seems to know how to fix it - -=
=20
> -
> was wondering if someone on this list might:
>=20
> The problem is with this line:
>=20
> if (class of configuration i of config) is (TCPIP v4 configuration)
>=20
> appleScript is complaining of a type mismatch problem.=C2=A0=C2=A0 I thoug=
ht perhaps
> putting
>=20
> if (class of configuration i of config) as string is (TCPIP v4
> configuration)
>=20
> might fix the problem, but that gave me a syntax error.=C2=A0=C2=A0 I've o=
nly been
> scripting for about 2 months.=C2=A0=C2=A0 Would anyone happen to know how=20=
to solve
> such
> type-matching errors?=C2=A0=C2=A0 The impression I get is that you can't c=
ompare a
> string to a class.
>=20
> - Rob
>=20
> In a message dated 10/2/02 7:08:18 PM, sarahr at genesearch.com.au writes:
>=20
> >
> > 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
> >
> >
>=20
>=20
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>=20
>=20


--part1_9c.27bb00b2.2ada01ce_boundary
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Content-Language: en

<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>
<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>
<BR>


More information about the use-livecode mailing list