I have a Finder macro palette that I only want to be visible if a Focused Finder Window is open.
In other words, if a Finder Window is open, and I click on the desktop, I want the palette to go away.
Or if I click on the Finder icon in the Dock, and because I have multiple desktops, it doesn't switch to the one with the Finder Window on it, I don't want to see the palette.
I don’t know if there is some KM configuration that will do this for you, but one solution (workaround) is to assign a hot key to the palette. Then you can show/hide it whenever you want.
FWIW, I have adopted a convention using ⌃⇧P as a hot key for almost all of my Group Palettes that are for a specific app (or set of apps). The palette can be distracting and get in the way, so sometimes I don’t want to show it.
First off, you’re specifying a specific window title (folder). I want my palette for all folders. Just NOT when it’s the desktop that’s active, not the Finder window.
But it turns out that won’t matter.
Click on the Desktop. Then click on the Finder window. Then click on the Desktop again. I’ll bet your palette stays active the second time. Am I right?
Just tried to do the same.
Finders behaviour on this is really strange. If you check for the title of the front window while desktop is active you get either the last focused Finder window name or an empty string (if no finder windows are open)
Can you let me know in case you found a solution for this?
Ahh, never mind. Found a solution. Pretty obvious in retrospective.
If the desktop is focused, the active window can't be closed. So checking if the menu item "Close Window" is disabled works nicely.
I would recommend a slightly more robust test condition, because I wouldn't deem it sufficiently unlikely that the insertion location could be another folder named "Desktop" elsewhere on the filesystem.
(assuming, that is, %UserLoginID refers to the user's "Account Name", which I believe it does.)
A stronger test, still, to cover rare instances where either a user's Home folder isn't named using their account name, or isn't located within the /Users/ folder, uses a script condition: