Re: Appletalk question
Re: Appletalk question
- Subject: Re: Appletalk question
- From: email@hidden
- Date: Mon, 8 Jan 2001 10:20:53 -0500
Frank,
Works like a charm. I ran it on my G3 on a 37 Zone network and it returned "TNY
Business" which is my current zone.
I did however, on the second to last line after "close database" have to put the
line "return s"
Also, as a general rule, you may want to use variable names with a little more
meaning like AppleTalk_Zone in place of s
-Steve
email@hidden on 01/08/2001 06:52:45 AM
To: email@hidden, email@hidden
cc:
Subject: Re: Appletalk question
At 13:34 Uhr -0500 05.01.2001, Stephen Gross wrote:
>
Is there a way to find out what appletalk zone I'm currently on through
>
applescript?
I could't try the following on my network, because there are no AppleTalk zones.
At least is compiles and runs on my machine, returning an empty string for the
variable z.
If you try it, would you please kindly post your results?
Thank you.
Frank Watzl
--begin script
--basic error checking only, improve for real life use :-)
tell application "Network Setup Scripting"
try
--you have to do this before reading/writing anything
open database
on error
return
end try
try
--active is a property of AppleTalk configurations
--see the Network Setup Scripting dictionary
set a to first AppleTalk configuration whose active is true
--AppleTalk Zone is a property of AppleTalk configurations
set s to AppleTalk zone of a
on error e number n
close database
error e number n
end try
close database
end tell
--end script
_______________________________________________
applescript-users mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/applescript-users