But it interferes with the Finder Rename function because now, if I do File/ Rename which I set to CMD+Enter, Enter doesn't confirm the renaming but enter the folder.
Is it possible to disable the Enter to open macro until I press the Enter or Escape? So the Enter will behave as earlier during renaming?
I think the best way to solve this is to combine the Open and Rename macros into one, because you can assign multiple triggers, and then detect which trigger was used and act accordingly. This seems to work on my Mac:
Macros are always disabled when imported into the Keyboard Maestro Editor.
The user must ensure the macro is enabled.
The user must also ensure the macro's parent macro-group is enabled.
System information
macOS 14.7
Keyboard Maestro v11.0.3
If you have other modifier-key actions on Return, just add them as additional cases before the otherwise. And note that %TriggerValue% returns graphics, not text. So Control is ⌃, Option is ⌥, and Shift is ⇧.
Thank you! But it doesn't work as I need.
When I press command+enter it executes Rename but when I press enter after rename, it opens folder instead of confirming rename.
Macros are always disabled when imported into the Keyboard Maestro Editor.
The user must ensure the macro is enabled.
The user must also ensure the macro's parent macro-group is enabled.
System information
macOS 14.7
Keyboard Maestro v11.0.3
This checks to see if the Undo Typing menu item is active, which will only be the case (hopefully) if you've just renamed a file. If that's true, it just sends Return. Otherwise, it does File > Open.
If this doesn't work quite right, then the trick is going to be finding a condition that's only true (and checkable via KM) just after renaming a file.
I think you're right—Found Image is probably the only way to deal with Spotlight, given that it's a floating window that doesn't really seem to exist. I added this as a condition for sending normal return:
The macro is very good. I use the move focus shortcut to menu (Ctrl + F2) and dock a lot (Ctrl + F3), and when I press enter, a file or folder opens, instead of opening the menu or launch the dock app. Does anyone know how to tell keyboard maestro to use the enter button to function normally when the focus has shifted away from the file (say to the dock, menu, context menu or a window with options)? Thanks Lance
You need to find some measurable condition that Keyboard Maestro can detect. I'm not sure what that might be, other than yet more Found Image conditions based on the screen changing—I don't think the active menus change when the focus changes, and it's sort of hard to check, because activating a menu disables the Dock's focus, for instance.
But you need to find a condition that's something that exists within the If-Then action possibilities in Keyboard Maestro.