title: `AXFocusedUIElement` <- does not get focused element (folder, file), it points to `Finder` menu
body: <p>trying to reproduce right-click context menu on my Mac.<br>
  I found such an article:  </p>
  
  <p><a href="https://beebom.com/how-right-click-using-keyboard-mac/" rel="nofollow noreferrer">https://beebom.com/how-right-click-using-keyboard-mac/</a>  </p>
  
  <p>I did accordingly but when I click my keyboard shortcut I get <code>Finder</code> menu not a currently selected file/folder menu.  </p>
  
  <p>This is an <code>apple script</code> used, </p>
  
  <pre><code>on run {input, parameters}
  
  tell application "System Events" to set frontApp to name of first process whose frontmost is true
  tell application "System Events"
      tell application process frontApp
          set _selection to value of attribute "AXFocusedUIElement"
          tell _selection to perform action "AXShowMenu"
      end tell
  end tell
  return input
  end run 
  </code></pre>
  
  <p>Spent hours trying to get this basic and obvious to every <code>Windows</code> user functionality to work, lost of time and very frustrating!</p>
  
  <p>I think code is correct, maybe there is something specific on my computer that stops it from working as expected?  </p>
  
  <p>Please help :-)</p>