How do I express "If something is selected in Finder"?


I currently have a macro that open a terminal window at the selected finder item (if the item is a directory, it opens the terminal in that directory, and if it's a file, it runs the file in terminal).

I would like to extend it so that if nothing is selected, it opens the terminal at the front finder window's path. How can I make a condition that checks if an element is selected?


try this macro. Check if it's for you.
nH when you select nothing in finder > get the path of front finder window v0_Backup_20200322_1217_v0.kmmacros (10.6 KB)

If nothing is selected, I'm not sure you you would determine the front Finder window's path.

However, the "Copy" item under "Edit" is not enabled if there is nothing selected.

The only tricky part is that the name of the item changes depending on what is selected. I think there's a way of telling Keyboard Maestro to match a regex but I'm not 100% sure what it is at the moment. Will try to find it and report back.


Yes, there is a way to do that, but there's an easier way: look to see if ⌘C is enabled: