3 Replies Latest reply on Oct 11, 2014 8:56 PM by maxwyss

    Lightroom 5: AppleScript: action “AXShowMenu” in Smart Collection panel does not show context menu

    maxwyss Level 4

      We are developing a simple automatization tool using Lightroom 5 (the newest version of the CC) using AppleScript.

      For some actions, we need the context menu in the Smart Collections panel, for example to import Smart Collection descriptions.

      According to the documentation and various sources on stackoverflow and elsewhere, AXShowMenu should bring up that menu.

      So far, I have not been able to make that context menu pop up.

      Using UIElementInspector and UI Browser, I located the element which does have the AXShowMenu action attached. Based on the code provided by UI Browser, I got the following script, which I run from the Applescript Editor:

      tell application "Adobe Photoshop Lightroom 5"

      activate

      tell application "System Events"

      tell process "Lightroom"

      set frontmost to true

      perform action 1 of static text "Smart Collections" of group 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" to activate

      Note that if you try to recreate this, the number of the window as well as the number of the row may be different. Also, the last line is just convenience, and not really relevant for the code.

      In the Results window in AppleScript Editor, I have the following:

      perform action 1 of static text "Smart Collections" of group 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 group 1 of row 11 of outline 1 of scroll area 1 of window 6 of application process "Adobe Photoshop Lightroom 5"

      which means that I did invoke the action.

      But … nothing happens.

      Any insight, workaround etc. is highly appreciated.

      Thanks in advance.