Prevent Macro Activation When in EDITING MODE?

I have created this Macro Group:

image

In this Macro Group I have created this Macro to go to the parent directory by pressing the BACKSPACE key:


(Please note that the BackSpace key is named as "Delete" here).

Of course, this has the following SIDE EFFECT:

When I edit a file name and use the BackSpace key to remove a character, then the Macro is undesirably activated. There seems to be no CONDITION to prevent activating the macro when in EDITING MODE. Or is there such a condition?

Hey Peter, I am not aware of any way that KM can determine if you are currently renaming a file, and I suspect such a feature doesn’t exist. I'm glad be proven wrong however.

For navigation, I typically use my trackpad and BetterTouchTool. For instance, in almost every application that has a "back" or "previous" command, I assigned that to a single tap on the center-left side of the trackpad. I also have the same actions assigned to my Magic Mouse by swiping right on it with two fingers.

So while KM might not be able to do this, there are some alternatives worth looking into. Let me know if you have any questions about BetterTouchTool.

-Chris

Hey Chris, thanks for your advices.

When programming in Windows, there is a way to detect whether a List control such as Finder is in editing mode. I am new to Mac programming, but I assume it should also be possible on Mac.

I don't use a trackpad. I am used to the BackSpace key from my Windows file manager. I could simply use ⌘UpArrow, but I created the macro to keep my old habit.

Happy festivities!

Try this AppleScript action, at the beginning of your macro::

image

Here's the AppleScript:

tell application "System Events"
	tell process "Finder"
		exists text field 1
	end tell
end tell

I can't guarantee that there won't be other conditions where this will return true, but if there are, they're probably something you want to skip also.

1 Like