I may have run up against an impassible limitation in UI scripting but I’m hoping someone might have a suggestion.
I want to script C1 Pro from PhaseOne (a professional photographer’s app) to select menu item “IPTC Editor…” from its Image menu. C1 Pro provides an AppleScript menu where it lists .scpt files found in its /Library/Scripts folder which is where I place my script.
First of all, does this affect how System Events works as opposed to being a stand-alone script application? I ask because I get errors such as NSAppleScriptErrorNumber = 10 for
tell application "System Events"
tell menu bar 1
tell menu bar item "Image"
tell menu "Image"
click menu item 28 of menu 1 of menu bar item 7 of menu bar 1 -- from UI Browser
end tell
end tell
end tell
end tell
and NSAppleScriptErrorNumber = 1 for
tell application "System Events"
tell process "C1 PRO" -- added this tell block
tell menu bar 1
tell menu bar item "Image"
tell menu "Image"
click menu item 28 of menu 1 of menu bar item 7 of menu bar 1
end tell
end tell
end tell
end tell
end tell
and the Image menu doesn’t even open up. If I forget System Events and instead use Extra Suites from www.kanzu.com as follows:
tell application "Extra Suites"
ES move mouse {350, 10} -- Image menu
ES click mouse
ES move mouse {350, 490} -- IPTC Editor...
ES click mouse
ES type key "return"
ES move mouse {227, 92}
-- Okay to this point, but the following mouse click doesn't seem to have any effect
ES click mouse
end tell
the Image menu appears, the IPTC Editor dialog box opens up, the cursor is properly positioned over the radio button I want to click, but the final click doesn’t have any effect, nor do any subsequent clicks or keystrokes, even with delaying.
Does anyone know what I’m missing with System Events or with Extra Suites, or can anyone suggest an alternative? Even if you don’t but have actually read this far, I appreciate it.
Thanks very much…
- Dan