Antw.: Re: Assistance for UI scripting text entry
Antw.: Re: Assistance for UI scripting text entry
- Subject: Antw.: Re: Assistance for UI scripting text entry
- From: Jon Rescca <email@hidden>
- Date: Wed, 23 Nov 2011 10:26:07 +0000 (GMT)
Op 19 okt 2011 om 17:16, Zack Jarrett <email@hidden> schreef:
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
Painfull indeed.
I still can't get the textfield accept any input via scripting. I tried a variation of commands, with no results.
The piece that should control the textfield so far:
tell application "System Events" to tell process "Leaf Capture"
set basenameField to text field "The Name of Your Processed Image" of scroll area 1 of tab group 1 of window ("Leaf Capture - SSD/Shots" as string)
tell basenameField
set currentValue to value --< works
set focused to true
keystroke return
perform action "AXConfirm"
set value to "w000t"
keystroke return
end tell
end tell
return currentValue
I am able to get the current value from the field, so I'm talking to the right object right? Anyone some more insight, or should I forget about the possibility to script this application further?
Thanks for your time!
Jon
_______________________________________________
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