This macro will "snap" a Macro Group Palette to an edge of the current Front Window. Like this:
or 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!
NOTES:
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.
INSTALLATION
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.
Can you post the the error from the log? The message is not entirely visible in the on-screen notifications.
You can easily find the log: KMEditor: Help > Open Logs Folder. It's the Engine.log.
No need to post the whole log file content, just the complete log entry that is made when the error happens. (An entry starts with a time stamp like 2017-09-19 22:46:03)
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
Iâve just seen in your screenshots that you are showing the palette settings of the group where the Snap Palette macros are in.
What I meant in the other post is the palette setting of the group where the target macros are in (e.g. your iA Writer group or whatever).
Please check the palette settings of the target groups (âShows a palette for one actionâ versus âShows/hides a palette whenâ/âShows a palette untilâ).