• 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: Assistance for UI scripting text entry
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Assistance for UI scripting text entry


  • Subject: Re: Assistance for UI scripting text entry
  • From: Zack Jarrett <email@hidden>
  • Date: Wed, 19 Oct 2011 09:16:15 -0700

Jon,
I usually set a text field by setting its focused attribute to true, then setting its value, then performing the AXConfirm action.
Alternately you can set the focus to true, then keystroke whatever you want, then do the AXConfirm action.  Sometimes text fields that stubbornly won't accept a value will accept one when you keystroke it in.  Also, as Bill wrote, using a tab instead of the AXConfirm can sometimes be the key.

Good luck.  UI Scripting can be painful.

tell application "System Events"
tell process "Leaf Capture"
set textField to text field "Type a base file name for your next shot." of scroll area 1 of splitter group 1 of window ("Leaf Capture - " & posixworkpath as string)
tell textField
set focused to true
set value to "Hello, world!"
perform action "AXConfirm"
end tell
end tell
end tell

Best Regards,
Zack

On Oct 19, 2011, at 4:30 AM, Jon Rescca wrote:

The small piece of code I have tried so far for setting the textfield doesn't seem to work, AppleScript doesn't fail, but gives no result either when executed.

set posixworkpath to "/Users/user/Desktop/myworkfolder"

tell application "System Events" to tell process "Leaf Capture"
set value of attribute "AXValue" of text field "Type a base file name for your next shot." of scroll area 1 of splitter group 1 of window ("Leaf Capture - " &posixworkpath as string) to "Hello, world!"
end tell

 _______________________________________________
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: 
 >Assistance for UI scripting text entry (From: Jon Rescca <email@hidden>)

  • Prev by Date: RE: Re: (no subject)That
  • Next by Date: Re: (no subject)That
  • Previous by thread: Re: Assistance for UI scripting text entry
  • Next by thread: (no subject)
  • Index(es):
    • Date
    • Thread