Sticky Palettes! They move when you do!
I like to have my palettes "docked" next to their windows, and if I move the window, I want the palettes to follow it. If this sounds good to you, follow the following simple steps.
First, download and install my "Snap Palette to Front Window Plugin Action".
Now, let's say we have a Macro Group called "Mail Palette", setup something like this:
We need a Macro Group that is available only when Mail is active, something like this:
And lastly (but see NOTE below), let's add this macro in the "Mail Active" Macro Group:
For "Macro G...up UUID" (aka "Macro Group UUID"): in the KM Editor select the Macro Group "Mail Palette" and then do "Edit->Copy as->Copy as UUID", and paste it here.
That's all we need with one caveat:
At the time of this writing, there's a minor glitch in Keyboard Maestro where the "focussed window" triggers we used in "Mail Palette" won't fire when the application (Mail in this case) is initially launched. You have to switch away from the application (i.e. Mail) then switch back to it one time before the palette becomes "sticky". Theres a workaround for this, below.
What if we want the Palette to stick to the application's "Main" window only?
If your application opens up other windows besides the main window, you may decide you don't want the palettes to snap to the other windows.
If you can find something unique about either the Main window, or the other windows, you can surround the "Snap Palette" with an "If" action, similar to this:
Devise your own as needed.
Workaround for the "Application First Launched" issue
As I mentioned previously, due to a small glitch in KM (at the time of this writing), the "focussed window" trigger conditions don't work when you first launch an application. Here's a quick workaround:
This workaround is for VLC. It will work with anything, though.
In a macro group with no conditions, I added this macro:
Then I changed the "Snap Palette" macro to add an additional "if" to the beginning:
Let me know if you have any questions or issues.