For completeness, here's a one line job that gets all the menu bar apps in one go: tell application "System Events" to get menu bar 2 of every process Now you should be able to target that menu icon with this command: tell application "System Events" to tell process "Bartender" to ¬ menu bar 2 (if it exists) will be the menu bar containing the application icon. Menu bar 1 is the menu bar containing the Apple Menu ( ) in the top-left. I ran a similar command for "dropbox" and it returned this: -> Run this command: tell application "System Events" to get every process whose name contains "bartender" As you've been doing already, we'll use GUI scripting to do this, so make sure Script Editor has permission to control your computer under System Preferences > Security & Privacy > Privacy > Accessibility (MacOS High Sierra).īecause I don't have Bartender myself, I need you do do some detective work in AppleScript for me (but it's good practice, as it shows you how to solve problems like this in the future): Part 1: Accessing the Menu Icon However, figuring out how to access the menu item using AppleScript is not too difficult. Hopefully I've this you correctly, not having Bartender myself. I'm gathering from your wording that you want to access a menu item of Bartender 3 that sits in the menu bar in much the same way as my Dropbox app does:
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |