Script Symbol

Does anyone know if/how you can refer to a symbol, like the one for the script menu in certain apps?

This is one that I encounter in DEVONthink.

Script Symbol

I'm trying to use a "Select or Show a Menu Item" action, but can't name the menu without a text title, right?

Could use a nudge in the right direction if someone's got a good way to accomplish this.

I don't own DEVONThink, so I can't give you a complete answer, but BBEdit has similar symbolic menus.

If I want to select a particular menu (or submenu) item from one of the "symbolic" menus, I choose it from the dropdown menu in the Select or Show Menu Item action.

and Keyboard Maestro fills in the appropriate fields.

Perhaps you've tried this and run into trouble (in which case I can't help you), but your question makes it sound as if you've been trying to fill in the fields by typing.

2 Likes

Pop the following into a new Script Editor document and run it:

tell application "System Events"
	tell application process "DEVONthink"
		name of every menu of menu bar 1
	end tell
end tell

...and the Script Editor "Result" window will show you an ordered list, left to right, of the menu titles. Copy the appropriate text, without the quote marks, into KM's "Menu Title" field and you should be good (tested with BBEdit's Scripts menu, which shows a similar symbol).

I've had to guess at what DEVONthink calls itself -- someone else might chip in if they know better!

1 Like

That item seems, alas, to yield missing value for the name property, and indeed for most other properties, other than size and position, which might at least define a rectangle for a click target.

tell application "System Events" to ¬
	tell application process "DEVONthink 3" to ¬
		name of every menu of menu bar 1
{"Apple", "DEVONthink 3", "File", "Edit", "Data", "Format", "Tools", "View", "Go", "Window", missing value, "Help"}

or:

tell application "System Events" to ¬
    tell application process "DEVONthink 3" to ¬
        set xs to properties of every menu of menu bar 1

item -2 of xs
{minimum value:missing value, orientation:missing value, position:{567, 24}, class:menu, accessibility description:missing value, role description:"menu", focused:missing value, title:missing value, size:{212, 495}, help:missing value, entire contents:{}, enabled:true, maximum value:missing value, role:"AXMenu", value:missing value, subrole:missing value, selected:missing value, name:missing value, description:"menu"}

Bum...

I suppose it's too much to hope that putting missing value in the KM box does the trick :wink: More seriously, I guess you could always resort to AppleScripting System Events, and refer to the menu by number rather than name.

Can you even see the desired DEVONthink menu using @DrDrang's route?

Just tried it and nothing shows up between the Window and Help items for me.

Well, that’s a shame. Not unexpected, though, given what @ComplexPoint found. AppleScript or JXA using numbered menus seems like the only way. There’s no way to access menus by number in native Keyboard Maestro, is there?

I find the easiest way to do this is to use the keyboard shortcut that focuses on the menubar (typically Ctrl-F2, but you can check your setting at the Shortcuts tab of the Keyboard panel in System Preferences), and then have Keyboard Maestro tab over the appropriate number of times to the menu symbol you are trying to reach. From there, a down-arrow opens up the menu and you can then type to select the menu item you want.

In the particular case of DEVONthink, the shortcut to the Help menu is, as for almost all Mac apps, Cmd-shift-/
From there, you just need one shift-tab to move left to the scripts symbol