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 14:41:23 +0200
Le 17 oct. 08 à 13:41, Bill Cheeseman a écrit :
on 2008-10-17 5:08 AM, Axel Luttgens at email@hidden wrote:
[...]
The 'keystroke' command only needs to be targeted at the application
process, not at a specific UI element. The keystroke is then
automatically
sent to whatever UI element is currently active (has keyboard focus)
in that
application, except that most applications will treat keystrokes with
command down as keyboard shortcuts.
Damn, you are right Bill...
In fact, I meant this one:
tell application "SystemUIServer" to activate
tell application "System Events"
tell application process "SystemUIServer"
tell window 1
tell text field 1
set focused to true
keystroke "abc"
keystroke return
end tell
end tell
end tell
end tell
so as to ensure to have the correct target, should a window have more
than one "focusable" element.
But even written that way, the script still remains somewhat
misleading wrt keyboard events, and this one might be preferred:
tell application "SystemUIServer" to activate
tell application "System Events"
tell application process "SystemUIServer"
tell window 1
tell text field 1
set focused to true
end tell
end tell
keystroke "abc"
keystroke return
end tell
end tell
Thanks,
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