Re: GU I scripting and Airport passwords
Re: GU I scripting and Airport passwords
- Subject: Re: GU I scripting and Airport passwords
- From: Axel Luttgens <email@hidden>
- Date: Fri, 17 Oct 2008 11:08:36 +0200
Le 17 oct. 08 à 08:16, Donald Hall a écrit :
When you select a wireless network from the Airport menu that
requires a password, a window appears on the screen with focus on a
text field for entering the password.
Has anyone been able to use GUI scripting to fill this in?
Here is what I tried:
------------------
tell window 1
tell text field 1 -- tried with and without this in a tell block
keystroke netPassword
keystroke return
end tell
end tell
-----------------
I've also tried "set text field 1 to netPassword".
In either case no text appears in the text field.
I tried something similar with the window that comes up for "Join
Other Network..." and the same scheme works just fine there - the
password field fills in.
What am I missing in the first instance?
Hello Donald,
All those GUI things are understood by "System Events.app" (SE), so
the whole code needs to be targeted to that application.
Thereafter, one needs to instruct SE about the process of interest, in
this case the process that is displaying the dialog window.
Finally, and you already did it, one needs to specify the object
hierarchy to be traversed.
So, this seems to be working as intended here:
tell application "SystemUIServer" to activate
tell application "System Events"
tell application process "SystemUIServer"
tell window 1
tell text field 1
keystroke "abc"
keystroke return
end tell
end tell
end tell
end tell
HTH,
Axel _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden