AppleScript: Lightroom 5: action "AXShowMenu" in Smart Collection panel does not show context menu -
AppleScript: Lightroom 5: action "AXShowMenu" in Smart Collection panel does not show context menu -
we developing simple automatization tool using lightroom 5 (the newest version of cc) using applescript.
for actions, need context menu in smart collections panel, illustration import smart collection descriptions.
according documentation , various sources here on stackoverflow , elsewhere, axshowmenu should bring menu.
so far, have not been able create context menu pop up.
using uielementinspector , ui browser, located element have axshowmenu action attached. based on code provided ui browser, got next script, run applescript editor:
tell application "adobe photoshop lightroom 5" activate tell application "system events" tell process "lightroom" set frontmost true perform action 1 of static text "smart collections" of grouping 1 of row 11 of outline 1 of scroll area 1 of window 6 delay 2 end tell end tell end tell tell application "applescript editor" activate note if seek recreate this, number of window number of row may different. also, lastly line convenience, , not relevant code.
in results window in applescript editor, have following:
perform action 1 of static text "smart collections" of grouping 1 of row 11 of outline 1 of scroll area 1 of window 6 of process "lightroom" --> action "axshowmenu" of static text "smart collections" of grouping 1 of row 11 of outline 1 of scroll area 1 of window 6 of application process "adobe photoshop lightroom 5" which means did invoke action.
but … nil happens.
any insight, workaround etc. highly appreciated.
thanks in advance.
i seek script on lightroom 4, same results here.
some application need real click.
try this
tell application "system events" tell process "lightroom" set frontmost true set {x, y} position of text field 1 of row 11 of outline 1 of scroll area 1 of window 6 realclick(x, y, "right") -- "right" = mouseright, "left" = mouseleft delay 0.5 key code 125 -- arrow downwards select first menuitem keystroke homecoming -- click on menuitem end tell end tell on realclick(x, y, leftright) shell script "/usr/bin/python -c 'import quartz.coregraphics qcg def mouseevent(type): e=qcg.cgeventcreatemouseevent(none, type, (" & x & "," & y & "), r) qcg.cgeventpost(qcg.kcghideventtap, e) if \"" & leftright & "\" \"left\": r= qcg.kcgmousebuttonleft; mouseevent(qcg.kcgeventleftmousedown); mouseevent(qcg.kcgeventleftmouseup) else: r= qcg.kcgmousebuttonright; mouseevent(qcg.kcgeventrightmousedown); mouseevent(qcg.kcgeventrightmouseup)'" end realclick applescript lightroom
Comments
Post a Comment