title: Applescript to click on a specific application in the Mac Status Bar
body: <p>I have an OS X application that runs as a status bar app. I am trying to do a test automation. Is there a way to click the status bar app using Apple Script? </p>
  
  <p>The script given below works only on native apps.</p>
  
  <pre><code>tell application "System Events" to tell process "SystemUIServer" to click menu bar item 1 of menu bar 1
  </code></pre>
  
  <p>I am looking for a similar functionality on custom apps. </p>