• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: GU I scripting and Airport passwords
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Re: GU I scripting and Airport passwords (From: Bill Cheeseman <email@hidden>)

  • Prev by Date: Re: GU I scripting and Airport passwords
  • Next by Date: Indesign & offsetting image within frame.
  • Previous by thread: Re: GU I scripting and Airport passwords
  • Next by thread: .mac sync now
  • Index(es):
    • Date
    • Thread