This macro will "snap" a Macro Group Palette to an edge of the current Front Window. Like this:
or even this:
This is useful in and of itself; additionally, it really helps when you drag a window, and you wish you could easily move its palette(s) to where you dragged the window.
Simple to use:
Copy the UUID of the Macro Group whose palette you want to control:
Paste the UUID into the Action:
Pick where you want it to snap:
It's a snap!
If you change the snap position and try the Action again, from the KM Editor, it might not work the first time you change the position. I think it's a quirk of Keyboard Maestro - the selection hasn't registered yet, or something like that. It won't affect how you'll normally use the macro.
The Snap Positions might be a little confusing at first, but try them and see what they do. Basically, the positions that start with "top" will be positioned along the top of the window. The ones that start with "left" will be positioned along the left side of the window, etc.
If the palette was hidden, it will un-hide.
Obviously, the Macro Group has to to be able to be "Active" for the window in question.
Drag the .zip file onto the Keyboard Maestro icon in the OS X Dock.
(if updating a previous version of the action, first manually remove the previous copy from the custom actions folder)
Great work. With the window-focus triggers, this makes for a nice "docked" palette (albeit with a 1 second or so delay). Super handy! (Although I do get some unexpected results with apps that have floating windows - Chrome always wants to attach the palette to the "hangouts" window docked in the corner of my screen.
I've found this plugin invaluable in both versions since the day you launched it. I've noticed, though, that my palettes snap to any child windows, dialogs, and popup menus that the application spawns. You can see it doing it KM itself in the below screenshot. Is there a way to keep the palette attached to just the main windows (or document windows, as in the case of MS Word)?
I've noticed, though, that my palettes snap to any child windows, dialogs, and popup menus that the application spawns
Yes, I've had this issue also.
Is there a way to keep the palette attached to just the main windows
Yes, although how you do it depends a lot on the application. The best I've come up with so far, is to add one or more IF conditions to check the window title, or check for a specific button, or something like that. Most often, I check it for something telling me NOT to snap the palette, like this, which I use for Finder:
I suspect that @ccstone might be able to come up with something more generic, based on window classes or some such thing, but this is the best I've come up with. It works, but I usually end up finding more conditions I have to add, as I continue to use it.
Hi @DanThomas, since KM 8 I always get a message that there is something wrong with the plugin. This message appears with every activated app. Also for those (here Safari) where the Snap Palette Plugin is not installed.
The error messages do not stop until I deactivate the plugin.
Thank you for your quick answer @Tom. Even if I take your suggestion into account, the messages come. There must be something wrong with the applescript
It's confusing that the plugin works (video), but that these messages are always displayed and then also in apps that I don't use with this plugin. I also only targeted the used apps, but even there I get the error messages in all apps.
Here is a screenshot of my settings. Under KM 7 this worked perfectly.
Weird. That’s the same error I had with “Shows a palette for one action” setting, as described above.
My guess was that — due to that setting — the palette disappears just in the moment before the AppleScript runs (thus the “no valid index” error). But I think this does not explain the behavior you are reporting.
I have to think.
BTW, you can copy from the log file (select the text, then press ⌘C) and then paste it here (⌘V). No need to post images