Re: Scripting the Location
Re: Scripting the Location
- Subject: Re: Scripting the Location
- From: Paul Berkowitz <email@hidden>
- Date: Sat, 30 Aug 2003 12:17:17 -0700
On 8/30/03 8:43 AM, "John C. Welch" <email@hidden> wrote:
>
If you open terminal, and just enter scselect, it lists all your locations,
>
giving each a numerical index starting at 0. scselect indexnumber changes to
>
that location. Examples below.
>
>
[localhost:~] jwelch% scselect
>
Defined sets include: (* == current set)
>
* 0 (Home)
>
1 (MIT)
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.
I can still get the result by:
try
set scText to do shell script "scselect"
on error errmsg
set scText to errmsg
end try
in order to make sure (?) it all works OK on unknown user machines. I can
then parse by paragraph and ( ) for location names and associated numbers.
But it would be nice to find some info on this [-n] switch and maybe how to
avoid it. It appears in the Terminal too, but not as an error.
Does anyone know why it occurs as an error in AppleScript but not in the
Terminal. Even if it's going to stderr, shouldn't that get to the 'do shell
script' result as it gets to the Terminal? (Maybe not, I don't know anything
about thus.)
do shell script "scselect > stdout"
doesn't help. Is there some way to avoid the error without a try/error
block?
--
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.