Re: Scripting the Location
Re: Scripting the Location
- Subject: Re: Scripting the Location
- From: Paul Berkowitz <email@hidden>
- Date: Sat, 30 Aug 2003 13:05:08 -0700
On 8/30/03 12:41 PM, "John C. Welch" <email@hidden> wrote:
>
On 08/30/2003 15:17, "Paul Berkowitz" <email@hidden> wrote:
>
>
> When I do it from 'do shell script' (OS 10.2.6), I get it as part of an
>
> error message instead of directly:
>
>
>
>
>
> do shell script "scselect"
>
>
>
> ERROR --> "usage: scselect [-n] new-set-name
>
>
>
> Defined sets include: (* == current set)
>
> 0 (Home)
>
> * 1 (Modem On)
>
> 2 (File Sharing)"
>
>
>
>
>
> What is the [-n] new-set-name all about? There is no 'man scselect' nor
>
> 'apropos scselect', and nothing in my 1100-page "Unix Power Tools" about it
>
> either.
>
>
Without any number after scselect, you get the current selection out of all
>
the configs. If you wanted to change to your Home setting, you would use
>
>
scselect 0
I'm fully aware of that from your last message, thanks. That wasn't the
question. What I'm trying to do is get the list of all locations, and the
current location (the one with the * ) in a reliable way, not to set the
location. My result for scselect in the Terminal included a line yours
didn't (or perhaps you excised it?):
"usage: scselect [-n] new-set-name
"
and when I did
do shell script "scselect"
in AppleScript, I got all this stuff as an ERROR, not as a result. I thought
I spelled this out in the last message, no? Try it yourself in AppleScript.
Do you get an error, or do you get a result.
Actually there were two questions:
1. Why am I getting an ERROR in AppleScript?
2. And is there any way to avoid it other than the try/error block I used?
The error number is 1 (yup, 1) so I can trap for that number particularly,
but I'd bet there's something more reliable I can do in the shell script to
avoid the error.
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.