Problem with "move or click mouse" - not giving proper screen coordinates

Hi all, first post here as I'm trying out Keyboard Maestro to add some extra functionality to my Stream Deck & Logic Pro.

I got the Stream Deck to speed up a few regular tasks that I need in Logic, which are usually a few clicks deep. Most have their own shortcut hotkeys but one that I use all the time doesn't.

There's a Browser button in the top right corner of the arrange page, which then gives quick access to the built in project and files details. Within this section are 2 tabs, which are not accessible via hotkeys and then within the one I need quick access to are 4 more tabs including Bookmarks, which I use in almost every project I ever work in as I have various folders within my sample and patch libraries bookmarked for easy access.

So I tried to use Keyboard Maestro and the mouse actions to do this. (I'm just testing the demo for now to make sure it does what I need it to)

The first time I did it was blind, having just run the super basic tutorial but I found the "move or click mouse" action and set 3 in turn: 1) Click on the browser tab 2) click on the all files tab 3) click on the bookmarks tab.
Now when I press the "Run" button at the top, it works but if I press the "Try" button the mouse teleports to a totally different part of the screen and the action does nothing.

I have tried setting the coordinates 2 different ways - firstly using the GET option and secondly using the Mouse Display accessible from the Windows menu. They both show totally different coordinates! So something is not right here.

I do have dual monitors, the screen on my laptop (MBP Mid 2015) and then an HD monitor connected via HDMI and the main arrange window is up on the connected HD monitor (1080p 24inch) so the fact that both of the screens run on a different resolution could be causing issues I guess?

Secondly, when I do have it working it only seems to run when Keyboard Maestro is the front most app, which also makes it totally pointless for what I want to use it for.

The KM link plugin for Stream Deck works fine but again, it only works on KM macros if the KM app is at the foreground and the focussed app.

I'm on the latest version of Keyboard Maestro 10.1.1 (only downloaded the demo yesterday) and using OS X Catalina 10.15.7

Any ideas would be hugely appreciated.

I've just done some more testing and it seems to be a bug with the "move or click mouse" option.

I've just tried a new version using the "click at found image" argument. The first and third steps have images that can be clicked, the second part of the argument doesn't. It's just a tab with "All Files" written on it.

I tried doing a quick screen shot of that but it doesn't recognise it, presumably because it's just text. o I used the "move or click mouse" just for that using the GET function.

If I use TEST for each part, one at a time they all work. But if I try to run the macro, the second part always fails.

Hi and welcome to the forum! I've done a fair bit of Logic / Stream Deck integration via Keyboard Maestro, so happy to help.

In case you're not aware... By default, move and click actions find coordinates relative to a corner of the front window. When pressing "Try", the front window belongs to the Keyboard Maestro editor.

The Get coordinates will be relative to a window corner and the mouse display will be absolute, relative to your entire screenset.

Is your macro in a group that is available when Logic Pro is the frontmost app?

If I understand you correctly, you want to navigate to the Fiile Browser's Bookmarks tab...

Set a hotkey in Logic for Open File Browser. Mine is ⌃⇧⌘F, so replace this in the macro as necessary. I've included a disabled pause, in case your system isn't as snappy as mine. Enable it if you need to.

Go To Bookmarks.kmmacros (47 KB)

Macro screenshot

2 Likes

Thanks, I'll give that a go.

I didn't have a shortcut to the file browser, that alone is great.

No, my macro didn't have something for the application at the front. Sorry, I'm a total noob to this! What is the action needed for that please? I reckon your action will work perfectly once I know what the action is to only pay attention to Logic.

thanks so much

Don't worry, I just did some poking about in the macro you uploaded and with a few tweaks I have it working.

For some reason, it doesn't want to work with the find image once it's on the second screen but as all my projects have the main Tracks window full screen on the top screen (the connected HD monitor) I have set it as a mouse click at an absolute position and it's working perfectly.

I saw how you had it in a Logic specific application folder, which is great. I had to go into it and assign it to my install of Logic, I guess this was set as an older version as it was still referring to Logic Pro X and they dropped the X some time ago.

but thanks so much for your help. It's now doing exactly what I wanted it to and working with the Stream Deck as I had hoped.

Now off to purchase Keyboard Maestro! I can see a lot of potential for this in my workflow.

1 Like

Great! Glad you got it working.

This'll keep you busy. Read the top bit and let me know if you want anything updating for 10.7.x.

1 Like

You don't show the action that is failing for you, so it is hard to know what the issue is.

It's not entirely impossible there is a bug, but it is far more likely the issue is with the configuration of the action and the expectation of the behaviour.

2 Likes

Hey Peter, this was resolved above by @noisneil

It was a combination of not using absolute screen positions and the fact I didn't know how to set an action to only work on a particular application.

thanks for checking in though.

1 Like

Cheers @noisneil, there's one there which is great! The "apply my defaults" one or whatever you have called it.
Super helpful as I'm often working with other people's files and it drives me crazy setting things up how I like them.

2 Likes

Glad to hear! Is it working for you or would you like me to update it?

With a bit of fiddling I have it working. No need to update, cheers!

I have been trying something else out though, which you might be able to help with.

I've set up a hotkey switch on the Stream Deck to launch the "learn parameter" function for mapping controllers to parameters and then a second press closes the window down, as long as it's highlighted.

But I think with KM I should be able to make it a bit more efficient.

Currently once the window has opened I need to manually click the Learn button and then close it once I'm done with it. I have got a KM Macro launching the window and pressing learn for me but I'm not sure how you then apply an action to a second button press on the Stream Deck when using a KM macro, so I can't specify a second push to close that window once I'm done.

Not sure how the 2 programs work together in that regard just yet but that's the next thing I want to try and get working.

Cheers!

How about this?

Learn Toggle.kmmacros (21 KB)

Macro screenshot

@BenKei

In fact, this is probably a better idea:

Learn Toggle v2.kmmacros (21 KB)

Macro screenshot

Sorry, I'm not sure how to implement that. I literally started with KM yesterday.

Here's what I have so far if it helps - this launches the window and clicks the learn button. What I want it to do is get to this point and swap so another press of the button would close that window regardless of if it was the front window or not.
I can already use the Stream Deck hotkey toggle to just open and then close a window but it'll close whichever is the active window, which will most likely be the plugin I want to automate.

So this would need to close the assignments window regardless of whether it's the front most window or not.

I hope that makes sense?

I reckon it's a pretty handy macro for Logic & Stream Deck users as I assume most people like to do live automation of parameters, I certainly do!

Cheers, Ben
Learn Parameters.kmmacros (25.8 KB)

Ok here's a version that doesn't care which window is at the front:

Learn Toggle v3.kmmacros (20 KB)

Macro screenshot

1 Like

Nice, I'm away from the studio now but will give it a try tomorrow.

I'm guessing that gets added to the end of the existing macro?

Thanks for all your help, I appreciate it.

No, it replaces it entirely.

If the Controller Assignments window exists, visible or not, triggering the macro will close it; if not, it will simulate the Learn new Controller Assignment shortcut, ⌘L. (This is the same as opening Controller Assignments and clicking Learn.)

Ah nice! I'll give it a go tomorrow. Fingers crossed it works for me.

Cheers Neil!

Morning, so I've just given this a try and the first part of the action works, it pops up the learn menu and activates.
The second press on the Stream Deck doesn't close the window though. It just deactivates the LINK Button in the top left of the plugin window.

That's the purple chain button in the image.

Almost there though!

Also, in all your Macros you refer to Logic Pro X. Is there a reason for this? The X was dropped from the file name back in 2020 so I need to amend your Macros to remove the X each time before they work.

I'm on 10.15.7 running Logic 10.6.2, so not even close to the newest version.

I wrote the AppleScript with reference to the button layout in Logic 10.7.4, so evidently some things have changed since 10.6.2. Replace "button 1" with "button 2".

Oddly enough, my Logic groups still referred to "Logic Pro X", but worked fine with 10.7.4! I've changed that now for the sake of good housekeeping.