This is my first applescript. I am trying to simulate using edit/find menu in Omnioutliner.
I think my only option is ui scripting. Is this true?
I’m using UI Element Inspector and have the following the following when pointing my mouse to the search string of the find dialog.
<AXApplication: “OmniOutliner Pro”>
<AXWindow: “Find”>
Attributes:
AXRole: “AXTextField”
AXRoleDescription: “text field”
AXHelp: “(null)”
AXValue (W): “xyz”
AXEnabled: “1”
AXFocused (W): “1”
AXParent: “”
AXWindow: “<AXWindow: “Find”>”
AXTopLevelUIElement: “<AXWindow: “Find”>”
AXPosition: “x=704 y=188”
AXSize: “w=468 h=22”
AXTitleUIElement: “”
AXChildren: “<array of size 1>”
AXSelectedText (W): “”
AXSelectedTextRange (W): “pos=3 len=0”
AXNumberOfCharacters: “3”
AXVisibleCharacterRange (W): “pos=0 len=3”
AXInsertionPointLineNumber: “0”
Actions:
AXShowMenu - show menu
AXConfirm - confirm
I want to change AXValue from “xyz” to “oak”. I use the following script:
tell application “System Events”
tell process “OmniOutliner Pro”
tell menu bar item “Edit”
tell menu “Edit”
tell menu item “Find”
activate menu item “find”
tell window “find”
tell group 1
tell text field 1
set value of text field to “oak”
(perform action “AXPress” of button “Next”)
display dialog searchText
end tell
end tell
end tell
end tell
end tell
end tell
end tell
end tell
I get an applescript error "Can’t set <> of <> to “oak”. Can anyone tell me what I’m doing wrong. I’ve spent a couple of days on this script.
Model: macbook pro
AppleScript: 1.10.7
Browser: Safari 523.12
Operating System: Mac OS X (10.4)