Select a menu item from a toolbar (which isn't available in the normal menu)?

I'm trying to create a keyboard shortcut which allows me to switch to some of these tools, found in Cubase's key editor window -

Specifically they are items which are oddly missing from Cubase's internal keyboard shortcut editor.

Namely, I wish to select the "paint" tool, which is the little icon on the end of that first row of icons, which is left to where it says "Grid."

I also wish to select and change the dropdown menu where you see it says "Velocity," to any one of these options -

Screenshot 2023-12-06 at 3.17.30 PM

However, while these names are exactly what they are called in the program, I'm unable to add them into KM because they don't exist in Cubase's menu items. I checked everywhere. Seems like the only access is right there on the toolbar.

Selecting by mouse or screen position won't work either because the position of this window changes constantly as I work.

Sorry if this has been asked before, but I'd love to figure out a way. Thank you!

1 Like

Have you read about the "Press Button" action? In KM v11, it has a new feature that may meet your needs. Since I don't have your app, I can't test it.

Also, for similar reasons, AppleScript might also work. But read up on the Press Button action first, since it's easier to use.

If the window moves, that doesn't matter as long as the location of the "Velocity" menu doesn't change. Just use a Click Mouse action, and set it to click at some distance off the top right corner of the window, and it should hit the menu every time, regardless of window location or size.

But I don't know the app, so maybe that menu moves around as well?


1 Like

Ah, yeah, maybe calling it a window is misleading, because technically the way I have it setup is it's a panel of many other panels which exists inside the main application's window:

I end up resizing the panel height all day based on whatever I'm doing. I tried the click mouse option with various settings but invariably as soon as I resize the panel, it's clicking the wrong place.

Interesting, though doesn't seem to work in my context. I wonder if it's because the button has to be literal text, and not an icon? I tried the one labelled "velocity" as well but nothing happens.

What is the AppleScript method you mentioned?

I can't be sure that you tried the right thing. Did you use the pull down menu to scan the buttons of your chosen application? And then did you use the menu a second time to see the names of the buttons? And if so, did you also tinker with the menu on the left of the edit box, which by default says, "Press Button named:". In your case, you may have to try the other four options.

Trust me, this is still worth checking before you get into an AppleScript solution. Don't give up on the Button action yet.

First of all, scanning the Cubase front window (version 13 in my case) resulted in “No buttons found”.

For the drawing tool, I would consider using Click Found Image. If an image appears more than once, a few options are available, such as: E.g. "Best", "Frontmost", "Leftmost" etc.. Since the bottom zone is quite limited in my opinion, I personally prefer to open the MIDI editor in a separate window (via a shortcut). This also prevents the same tools from appearing on the screen twice.

If I like to select items from a sub menu I would also use a click (on position or found image) and with the menu open use "Insert Text by typing" using the first two or three letters - depending on the given entries, followed by a typed keystroke "Return".

Yes, I tried these steps. Unfortunately, a scan results in no buttons found.

Hi, this ended up working very well for me, regardless of screen positioning and moving things around! I personally usually prefer working with the key editor in the bottom zone, just a matter of choice and what I'm used to.

I created a handful of tools with precise conditions, and thought I would share them here, in case you want to check them out as a fellow Cubase user (I'm also on v13).

1. Click Line Buttons Based on Visible Conditions (Key Editor)
This one simply selects whatever 'current' tool is enabled in the line tool button at any given time. Whether that's line, sine, square, or paint - it basically just activates the tool, only inside the key editor window (lower panel).

Click Line Buttons Based on Visible Conditions (Key Editor).kmmacros (150.0 KB)

2. Toggle to next Line Button Based on Visible Conditions (Key Editor)
This one is simply a toggle which will move downward through the next available "line" tool, in order. Once it reaches paint, it goes back to the beginning. It works whether the tool is currently active or not.
There's one oddity I cannot seem to figure out, which is it gets hung up on switching from Triangle to Square, but only when it's inactive. It has otherwise the same code as the others so I have no idea what that's about. Going to try to debug this later.

Toggle to next Line Button Based on Visible Conditions (Key Editor).kmmacros (316.7 KB)

3. Activate Paint Button even if not visible (Key Editor)
In many ways this is what I originally set out to do - a keyboard shortcut which simply allows me to select the paint tool while in the key editor. There are certain things it does well over the draw tool, in particular allowing me to quickly "paint" fast notes of the selected grid value. This will allow me to simply turn it on quickly when I want.

Activate Paint Button even if not visible (Key Editor).kmmacros (276.7 KB)

4. Change Event Colors - based on Velocity, Pitch, Channel, or Part (from the right-hand dropdown)
These are the four which I use quite often. Currently mapped to shortcuts which makes sense to me, allows me to quickly change color views. Fortunately this didn't require any area conditions, so I think it should work in any type of window (panel or full).

Key Editor Event Colors - Primaries.kmmacros (42.7 KB)

5. Change Event Colors - Toggle/Cycle through the menu
I'll admit I'm less likely to use this than the one above, but since I came this far figured I might as well create it - basically allows for toggling up, down, or in a cycle through the Event Colors menu in the Key Editor. The one which cycles through is set so that it skips the "setup" menu. Again this has no area conditions so should work in any window.

Key Editor Event Colors - Toggle Cycle.kmmacros (85.9 KB)

I think to make any of these work in a non-panel full Key Editor window, you would simply remove the "area" zones I created. Note I have my Cubase set to a pretty dark mode. Therefore, I have no idea if the contrast and color of the icons as I screengrabbed them would work on other people's computers the same, but the principles are all there so it could just require simple image swaps. You'll notice I had to create conditions for when the button was highlighted (active) and not highlighted (inactive), to account for certain tasks such as the toggle line tool action, so you can keep toggling regardless of whether the tool was originally active or not. Wherever possible, I set it so that the mouse will return to its original position, so it won't jump around on you - the only case I couldn't get this working was for #5, which appears to require I use 'hold' on the found image actions, and therefore the mouse position cannot return to where you had it.

All in all it seems to work great and I'm happy. Probably overkill for everyone but figured I would share in case you want to try it out - and I'm open to any feedback!

Thanks again!

1 Like

If you're happy, I'm happy. Sorry that my ideas didn't help.

1 Like

Thanks so much for the descriptions and sharing your results. Looks great to me.

Unfortunately, I don't have that much time (or desire) to really work on projects in Cubase at the moment. As soon as this changes I'll definitely check your macros.

Thanks again and enjoy your weekend.

1 Like

No worries, I'll surely give that Press Button action a try in the future - it's good to know about for sure. Not sure why it wouldn't show for Cubase, but either way I'm glad I got something working. Cheers!

No worries at all – figured I would share the results of my labor in case anyone in the future who uses Cubase finds this thread, maybe it would help them. Take care!

1 Like