I'm trying to access the menu of an NSRunningApplication
object in OS X. it has an ownsMenuBar
@property, however no instance of an actual menu bar (which makes sense). I'm curious, instead, how to get access to that menu-bar that NSRunningApplication
knows of when one exists. KVO perhaps? Is there any (even small) relationship between an NSRunningApplication
and an NSApplication
?
Thanks!
-----edit------
djai djan, you've been super helpful and here is the code i've managed to make work from your suggestions!
tell application "System Events"
return menu bar of first process where frontmost is true
end tell