Re: Scripting the Location
Re: Scripting the Location
- Subject: Re: Scripting the Location
- From: "John C. Welch" <email@hidden>
- Date: Sat, 30 Aug 2003 11:43:12 -0400
On 08/28/2003 19:34, "John Delacour" <email@hidden> wrote:
>
>
>
> tell application "Finder" to activate
>
> tell application "System Events"
>
> tell process "Finder"
>
> click menu item "Home" of menu "Location" of menu item
>
> "Location" of menu "Apple" of menu bar 1
>
> end tell
>
> end tell
>
>
>
I find I have to do something like this, which is clearly not the way
>
it should be. I've replaced the names with numbers just so things
>
fit on the line.
There is a far easier way to script network changes than UI scripting. You
use the 'scselect' utility with a "do shell script" statement.
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)
[localhost:~] jwelch% scselect 1
CurrentSet updated to 1 (MIT)
[localhost:~] jwelch% scselect 0
CurrentSet updated to 0 (Home)
I'd recommend this over UI scripting.
FAR less work and less fragile too.
john
--
Magister Mundi sum!
(I am the Master of the Universe!)
_______________________________________________
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.