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.
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.
@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.
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.
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.
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 -- by Switch/Casing the variables based on the trigger tokens (maybe even the "frontmost app" token).
I spent my entire morning trying to do this, and I was far from achieving this great solution.
(In fact I downloaded it when you posted it and...completely forgot about it. Sigh)