Helper Menu Selection in a Macro

I was wondering if there is any interest in creating a way in KM to create a macro that can access one of the many helper menus that runs in the menu bar. I am referring to those small icons for many popular apps that run in the menu bar. I am starting to use Grammarian quite a bit for editing of my book. For some reason there is no longer a seamless integration between the editing of the text in a document, and launching Grammarian as a helper app. The only way for this to work is by copying a block of text, going to the desktop, selecting the pencil icon in the helper app for grammarian, and navigating down one level, and then navigating over to a three level drop down menu.

I have tried using absolute position, positioning the cursor over the icon in the menubar and clicking, and yet all of these attempts have come up extremely unreliable at best. Part of the problem is that helper menus tend to move around depending on how may are running at any given time.

i love the option in km to trigger the menus in a program, but as Grammarian has a separate menu that contains no editing information, only preferences, etc. I must get into the helper app to be able to do anything with it.

Is selecting the menus and submenus in a helper app the is running a suggestion that is of interest to the developers of KM?


I use a little app called 'Bartender"
It keeps all of those menubar icons in the same physical place, (and much more) even between restarts.
If the icons stay put, some of your ideas may work well.



Good to know, thanks. I still wonder how my question can be addressed in KM however. The helper apps running in the menu bar exist, have names, have set menus, and should be available in a system resource file somewhere. Surely if KM can call a specific menu and submenu for a running application, it can also do this for a helper app. Maybe, yes, no?

1 Like

Hi @levelbest, if the Menu Apps are to be controlled via AppleScript, then you can enable it with this script:

tell application "System Events"
	tell application process "Yoink"
		tell menu bar 2
			tell menu bar item 1
					with timeout of 0.1 seconds
						perform action "AXPress"
					end timeout
				end try
			end tell
		end tell
	end tell
end tell
do shell script "killall 'System Events'"
tell application "System Events"
	repeat 3 times
		key code 125
	end repeat
	key code 36
end tell

In my example, I am restoring a deleted content in the Yoink app.

As you can see in the GIF, this opens the menu and calls the desired action. If, like @Steve_E, you use the Bartender app, then this display is hidden. It is then something for the eye because as if by ghost hand :wink: