MACRO: Palette Organizer v1.3 (updated Dec 3, 2021)

I made a minor "tweak" to the v1.1 macro, changing the "field separator" character used internally from \t to β”… (because I have some macros with tab characters in their names, so that text in palettes lines up, etc.). I chose β”… because it seems to be a character no-one else might accidentally stumble upon.

Changes

Changes were made as follows:

  1. Changed line 1028 in from the "Custom Floating HTML Prompt" HTML in the section "Prompt the user to re-order and re-number, abort if canceled" from:

result.push(macro.macroUUID + "\t" + macro.macroName + "\t" + macro.prefixNumber + ")" + macro.macroNameNoPrefix);

to:

result.push(macro.macroUUID + "β”…" + macro.macroName + "β”…" + macro.prefixNumber + ")" + macro.macroNameNoPrefix);

  1. In the action "Search β€˜palorg_Line’ returning palorg_Number, palorg_MacroName, palorg_MacroUUID", changed the regex from:

^([^\t]*)\t([^\t]*)\t(.*)

to:

^([^β”…]*)β”…([^β”…]*)β”…(.*)

Might be useful for others if this change can be incorporated into the "official" version.

Thanks for a superb (!) macro.

I never thought of using tab characters in the macro names. You said you use them so that text in palettes lines up - can you post a pic or two of the palettes? Thanks!

What a very useful tool! Thanks @DanThomas!

Would it be possible to re-arrange macros's order (select, drag, drop macros from the mouse/trackpad) from the Palette organizer?

Thank you!

You're welcome. And nope. I mean, yes, someone could probably modify it for that, but it's a lot of work. Especially for something you don't use all the time (except at the beginning, when you're getting everything organized). Sorry. :smile:

Is there a way to rename more than 67 macros of one macro group?

I had a group with 168 macros that I trigger in only one specific application and had to split them in a few groups because of the 67 limit.

Palette Organizer is for renumbering the two-digit prefix number. Since you can only have 2 digits for the prefix (unless that's changed?), the limit should be 99, not 67. At least, it should be 99, not 67. Are you seeing something different?

Selecting 242 macros of a macros group displays "Starting Number must be a number between 1 and -242." error message.

Selecting 67 macros of a macros group at the same time displays "Starting Number must be a number between 1 and -67." error message.

Any plan on making Palette Organizer renumbering three-digit prefix numbers?

Select the 67 macros before you run Palette Organizer. You can select up to 99 macros before running Palette Organizer.

As for 3 digits, as I mentioned earlier, Keyboard Maestro only supports 2-digit prefix numbers. So having Palette Organizer support 3 digits wouldn't serve any purpose.

If you want that many macros on a palette, break them up into two palettes. You can easily align the palettes next to each other.

Ok. That makes sense.

How would you align palettes next to each other?

They stay where you put them, so just do it manually. The next time they open, they'll be in the same place.

Or if you want to keep them with an application's window, even when you move the window, you could try something like this, which I also wrote: Sticky Palettes! They move when you do!.

Ok. Thanks for the tip. :+1:

After a few days using Palette Organizer, I wanted to give a little feedback.

1Β°) What an AMAZING addition to Keyboard Maestro. It should be a Keyboard Maestro built-in feature.

2Β°) I generally had to wait way longer than you in your Youtube tutorial when launching Palette Organizer via a keyboard shortcut. Sometimes 20 secondes. I do not know why. I do not precisely recall if I was having a lot of applications running at the very same time but I definitely can say I only do have 10-15 macros max in my Palette Organizer.

3Β°) I experienced an inconstant behaviour when the macro had no action already set. Most of the time, I had to launch the Palette Organizer 2 or 3 to finally be able to insert the macros via the Palette Organizer.

1 Like

100% agreed :slight_smile:

Interesting, I wonder why it's slow on your machine. 20 seconds is ridiculous. I can't imagine you have that many favorites yet. I'm not sure how to debug this, though. Maybe some other application is interfering with it? Something that affects the Web engine?

...and @politicus: Honestly, I wouldn't be a bit surprised if Peter felt this was a good enough solution that he didn't need to bother with it (at least for now). I've told him many times that if he ever implements something I made a macro for, I wouldn't be offended at all. In fact, anything he develops will surely run better because he has access to the internals.

Tried to renumber and add divider texts yesterday and today got such message error many times (5 or 6) as I tried many times.

The weird thing is as I was trying more and more the number of error messages I got was going lesser and lesser. For example, first renaming and 4 divider texts adding trial got me 3 errors. Second trial got me only 2 and so on.

Only one divider text was added per trial. Got no error message when I only added a divider text at a time.

Now all the macros of my group are renamed, divider texts added after around 10 trials.

Try changing this, and let me know if it helps:

Find this action:

image

Here's the text of it:

tell application "System Events"
	tell application process "Keyboard Maestro"
		tell window "Keyboard Maestro Editor"
			tell scroll area 2 of splitter group 1 of group 1
				set focused to true
			end tell
		end tell
	end tell
end tell

Paste this in instead:

tell application "System Events"
	tell application process "Keyboard Maestro"
		tell (first window whose subrole is "AXStandardWindow")
			tell scroll area 2 of splitter group 1 of group 1
				set focused to true
			end tell
		end tell
	end tell
end tell

Let me know if that helps. Thanks!

Looks like it is working. Thank you!

1 Like

Dan, perhaps it would be helpful to update your macro/script in your OP to fix this issue.

Done.

1 Like