Is It Possible to List All Sub-Menu Items Under One Menu in an App?

Hi , I really like the trigger menu item function in KM. But I find that there are too many items under audiosuite menu in Pro tools, I want to list all of them , then find them just by tying a few charaters.

I dont know whether it's possible , I think there should be some way, becuase we can see all the menu items of one app when applying action in KM action meu.

You can use the Prompt List Action which support searching
image

1 Like

@Koozer_Zhang I don't have Pro Tools, so I can't test this, but...

AudioSuite Picker.kmmacros (47 KB)

Macro screenshot

...works for me in other apps and might at least be a starting point for PT.

You can't do that with Keyboard Maestro. But...

  • There might be a plug-in for Pro Tools that does it.
  • Some creative use of AppleScript UI-Scripting might be able to do it, and KM can run AppleScript.

Run this from Apple's Script Editor.app, and see what you get:

tell application "System Events"
   tell application process "Pro Tools"
      tell menu bar 1
         tell menu "AudioSuite"
            set menuEntireContents to its entire contents
         end tell
      end tell
   end tell
end tell

try
   
   menuEntireContents / 0
   
on error errMsg
   set menuListing to errMsg
end try

return menuListing

Copy the result to a text file, zip it, and post it here.

Tell me how long the script takes to run.

@ccstone That's what my suggestion above does. I tried it on a few apps and it works but @Koozer_Zhang will have to try it in Pro Tools as I don't have it.

Hi Guys,

Very excited to see your answers. Thank you so much from deep of my heart!

Now it partially works. Because the the audio suite has two layers of menus. The target plugins are categorized in a submenu. Now I can get the result of first layer. It's quite close.

This may not be fast enough for your purposes, but choosing menu items by typing the first (or first few) characters is built into macOS. If you assign a keyboard shortcut to this AppleScript

tell application "System Events"
	tell application process "Pro Tools"
		tell menu bar 1
			click menu "AudioSuite"
		end tell
	end tell
end tell

the AudioSuite menu will open. Typing "s" or "so" will select the "Sound Field" item. Return or right-arrow will then open the "Sound Field" submenu and you can start typing the names of any of the commands in that submenu (you may need to use the up and down arrow keys to work through items that start with the same letters). Return will then run the selected submenu item.

Again, this may be too slow for you, but it will show you all the possibilities and give visual feedback as you type.

Thanks for your idea. Although it doesnt exaclty solve my problem, but it's great to find out tying letter can jump to the target faster.

So one long, alphabetically sorted, list of all the Audiosuite menus and submenus would be OK?

Is it just sub-menus, or do you have to deal with sub-sub-menus too?

I think it will list all the items under submenu of audiosuite shown in the picture .

The good new is Pro tools just update the new version which include the feature. You can use pro tools search to realize the function. But I am still curious how to realize it in KM.

Come on @Nige_S, you know you wanna... :wink:

Been a bit busy with Jubilee stuff, but...

Here's what @noisneil and I have been working on. The "Generate" macro will create a global list of all menu items for a given application menu bar item, the "Picker" will let you search and select an item using KM's pick list.

Check that the first three actions are set to the app name, menu, and global you want to use (neither of us have Pro Tools to check this). You could set it to trigger on application launch, but may need to increase the pause from the current 0 seconds to allow the app time to build the menu.

You'll probably want to add an hotkey trigger to "Menu Item Picker" and, for safety, I suggest you change all the "Select Menu" actions to target Pro Tools rather than the frontmost app. When you call it you'll get a list of every menu item (regardless of depth) which you can then filter by typing in the pick-list box and use arrow and return keys to activate a menu item

All menu items, even the unavailable ones, will be listed -- though that should be less of a thing for a plug-ins menu than for, say, the "Edit" menu. You could easily make these work across multiple apps, either by duplicating and changing them or -- and much cooler :wink: -- by Switch/Casing the variables based on the trigger tokens (maybe even the "frontmost app" token).

Enjoy!

Menu Item Picker Macros.kmmacros (17.5 KB)

Summary


2 Likes

Hi guys, you are just amazing! I just open it and it works very well. I did nothing. It works.It works!

Thank you guys so much.

1 Like

All credit to @Nige_S. I was just his muse. :joy:

Hah! Muse! The hero behind. :nerd_face:

This is fantastic! Thank you @Nige_S and @noisneil !