Assistance for UI scripting text entry
Assistance for UI scripting text entry
- Subject: Assistance for UI scripting text entry
- From: Jon Rescca <email@hidden>
- Date: Wed, 19 Oct 2011 11:30:01 +0000 (GMT)
Hi list members,
I'm currently working on scripting Phase one's Leaf Capture. One hurdle I have now is the ability to enter text in one of the application's fields. Leaf is only scriptable via UI scripting, and I've come a long way already. Anyone any insights in what I'm doing wrong, or could do better?
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
The following data is gathered by Accessibility Inspector.app:
<AXApplication: “Leaf Capture”>
<AXWindow: “Leaf Capture - /Users/user/Desktop/myworkfolder”>
<AXSplitGroup: “672”>
<AXScrollArea>
<AXTextField: “Type a base file name for your next shot.”>
Attributes:
AXParent: “<AXScrollArea>”
AXRole: “AXTextField”
AXRoleDescription: “text field”
AXHelp: “Type a base file name for your next shot.”
AXWindow: “<AXWindow: “Leaf Capture - /Users/user/Desktop/myworkfolder”>”
AXTopLevelUIElement: “<AXWindow: “Leaf Capture - /Users/user/Desktop/myworkfolder”>”
AXEnabled: “false”
AXSize: “w=236 h=23”
AXPosition: “x=24 y=295”
AXFocused: “false”
AXTitle: “Type a base file name for your next shot.”
AXValue: “old_data”
AXSelectedText (W): “”
AXSelectedTextRange: “pos=3 len=0”
AXNumberOfCharacters: “3”
AXVisibleCharacterRange: “pos=0 len=3”
AXInsertionPointLineNumber: “0”
Parameterized Attributes:
AXLineForIndex
AXRangeForLine
AXStringForRange
AXRangeForPosition
AXRangeForIndex
AXBoundsForRange
Thanks for your time,
Best,
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