Get Menu Path Text from Menu and Popup Menus
Inspired by @John_Morris that hates to type, this scripts helps with writing the path to menus without spelling mistakes.
for menus:
How do I copy and paste PT menu paths so that I don't have to type and miscapitalize #post-10
for popups:
How do I copy and paste PT menu paths so that I don't have to type and miscapitalize #post-11
You can copy and paste each name to a macro, or hole path to a script

Hope this helps
- Raphael Sepulveda @raphaelsepulveda2021-04-22 18:02:24.314Z
Hell yeah! This is cool! You should put these in the store!
- In reply tosamuel_henriques⬆:Kitch Membery @Kitch2021-04-22 19:27:40.500Z
Love this! Nice one @samuel_henriques :-)
- In reply tosamuel_henriques⬆:Kitch Membery @Kitch2021-04-22 21:19:50.986Z
Here's an Idea to add @samuel_henriques,
How about adding a third button to paste the paths into a Click Menu Item path property :-)
Something like this.
const menuPath = ["AudioSuite", "EQ", "F6 Mono"]; menuPath.forEach(p => { sf.clipboard.setText({ text: p }); sf.ui.frontmostApp.menuClick({ menuPath: ['Edit', 'Paste'] }); sf.keyboard.press({ keys: 'return' }); });
samuel henriques @samuel_henriques
Cool @Kitch I was wondering how to do this.
It's working now, I'll update in a bit.But now I'm wondering If I could do a template the same as the "Open & Select Item in Popup Menu" or "Click Menu Item" and have a "pick" Menu Path button that would trigger the script.
samuel henriques @samuel_henriques
Almost there but need a bit more work,
At this time, to pick a new one I have to select the "Menu Path" area, focus the app I want a new path, and use a trigger to run the script this preset, at the end of the script, it will activate soundFlow and paste the path (your code)
Since I get the value from the script, is there a way to get that value in the "Menu Path" area?
Also. how do I hide the "Target Value" property to the advanced properties
Thank you
Kitch Membery @Kitch2021-04-23 18:09:22.470Z
Legend! I feel that implementing this as one command template is not the best approach (I may be wrong though).
I would suggest 2 scripts. One to collect and store the menu path (in a global variable) and another to paste it into the path.
I feel your script should maybe be used as more of a utility. Creating a command template for this seems counterintuitive as people will try and use it as a macro action.
I'm certainly not dismissing the idea, however, I feel Christian would have implemented the "Click Menu Item" Macro action this way, to begin with, if it was the best approach.
With all that said I will be using this script to save on some keystrokes and head-scratching due to spelling mistakes. :-)
samuel henriques @samuel_henriques
Thanks mate, I arrived to the same conclusion. I was trying to complicate stuff that are already working properly.
I think I got a good thing now, I'll be posting this in the store for everyone to use.
Here's a video:Let me know if you find any way to make this better.
And thank you to everyone.
Kitch Membery @Kitch2021-04-23 19:11:16.343Z
Fantastic!! I'll check it out shortly :-)
samuel henriques @samuel_henriques
UPDATE: It's live in the store, my first one
samuel henriques @samuel_henriques
And updated the store with the Menu Path version as well.
Here's a video:
https://we.tl/t-2YYhkLcXJv
- AIn reply tosamuel_henriques⬆:Alex Oldroyd @Alex_Oldroyd8
This is so helpful, @samuel_henriques ! Thank you. Just wondering how you would use the code to return the currently selected menu path of a popup menu as a string?
samuel henriques @samuel_henriques
Hello Alex,
As it is working now, the script sets the path in SF, and it sets the clipboard wit the path as well, so you can paste it on your script.- AAlex Oldroyd @Alex_Oldroyd8
Thanks Sam. I probably didn't explain myself.
I'm attempting to fetch the currently selected menu path of a popup menu as an array to then use later on in the same script with Open & Select.
I've been through the code of your script, but I can't work out how to isolate the already selected path as opposed to all possible paths... Thanks you!!
samuel henriques @samuel_henriques
got it,
Here's an example. let me know if you get stuck.- AAlex Oldroyd @Alex_Oldroyd8
That's the one!! You're a hero! Thanks so much :)
- AIn reply tosamuel_henriques⬆:Alex Oldroyd @Alex_Oldroyd8
Hi Sam. And @Kitch ? Is it just me, or is this no longer working? I'm on Sonoma 14.1. It used to work so well on my old machine.
Is there anything i can do to get it working again?
Thanks
AlexKitch Membery @Kitch2024-08-22 18:04:56.110Z
Hi @Alex_Oldroyd8,
Can you provide more information, What is the script that you are using? ...and are you seeing an error message?
- AAlex Oldroyd @Alex_Oldroyd8
When i use the Pick Path From Menu macro, i set it up as instructed and as i used to. When i run the script from a key command, with Logic focused, the window pops up to let me choose the menu items, but then i get an error and the script fails to enter the menu items into the Click Menu Item macro Menu Path .
23.08.2024 11:31:51.86 <info> [Backend]: Logging unknown error in action (02) RunCommandAction: Pick Path From Menu: Line 24 !! Command Error: pick path [user:clad2w0hi00013e10bl7r3ezg:cm06kn77c000cvb104seeklm3]: @Error running command user:1642499476722:cknunn6j600061910550vuyxl (pick path: Line 1) Could not find running app with bundle id: '' (Pick Path From Menu: Line 24)
Kitch Membery @Kitch2024-08-23 17:29:04.174Z
Hi @samuel_henriques, do you have any thoughts on this?