Re: Toggling Appletalk active/inactive with Applescript?
Re: Toggling Appletalk active/inactive with Applescript?
- Subject: Re: Toggling Appletalk active/inactive with Applescript?
- From: Nigel Garvey <email@hidden>
- Date: Wed, 25 Jul 2001 15:46:41 +0100
Jan Pieter Kunst wrote on Mon, 23 Jul 2001 22:17:49 +0200:
>
Hello all,
>
>
Is it possible to set Appletalk to active or inactive with Applescript? This
>
(the idea for which came from O'Reilly's "Applescript in a nutshell", which
>
every scripter should buy IMHO) :
>
>
>
>
tell application "Netwerkconfiguratie-scripting"
>
try
>
open database
>
get AppleTalk active of transport options 2
>
--> true
>
>
set AppleTalk active of transport options 2 to false
>
close database
>
on error errmesg
>
close database
>
set msg to errmesg
>
end try
>
end tell
>
>
display dialog msg
>
>
>
>
... results in a dialog: "Configuration locked" (or "secured"; translating
>
from Dutch).
Changes to configuration and option settings have to be done as part of a
'transaction'. Also, it may be wiser to specify 'AppleTalk options 1'
rather than 'transport options 2', in case the current AppleTalk option
is ever *not* the second transport option.
tell application "Network Setup Scripting"
try
open database
AppleTalk active of first AppleTalk options whose active is true
--> true
try
begin transaction
set AppleTalk active of first AppleTalk options whose active is
true to false
end transaction
on error
abort transaction
end try
close database
on error errmesg
close database
set msg to errmesg
end try
end tell
NG