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

If you’re going to append the numbers then maybe put a dot in front of the number. To, as I said above, distinguish from numbers in the text of the action title.

(In my case data set qualifiers can’t start with a number, but they can contain them and dots are used as qualifier separators. So maybe dot is the wrong thing for me to prefix a numeric choice with.)

I'm not sure whom you are replying to. If to me, the numbers shown at the "end" of the Macro name are not part of the name, but the Trigger for that macro.

I’ve lost track of who I’m replying to, too. :slight_smile:

My entire point in this thread is to think of ways of using numbers as shortcuts when invoking palette items. But without inadvertently selecting the wrong item - because it contained a numeric digit.

I don't think that should be an issue.
As I said above:

So the name of the Macro is irrelevant in a normal Pallet. OTOH, Conflicts Palettes do use characters in the Macro Name to select the Macro to trigger.

1 Like

Hello again all.

I commented above a few times discussing with Dan about adapting his Palette Organizer to accommodate more than just two numerical digits, after I learned from Peter that letters and in fact almost any characters can be used in those first two characters followed by the ")" to sort and organize macros. Dan was helpful in advising how to adapt his code, based on assumptions I made about how KM would sort characters beyond the two numerical digits. I've been working on it since then on and off, but sadly this has turned out to be a great deal more complicated than I (a) thought it would be and (b) feel it should be.

Thank you to, jonathanl - your post explained the "natural sorting", which cleared up some of my issue, but it turns out it it appears to still be a lot more complicated than that even...

That "natural" sorting combined with the two character limit seems to me to make it extremely difficult to organize macros programmatically in any sensible way. “Natural sorting” makes sense when dealing with file names or any other kinds of names that want to be sorted based on numbers somewhere in the names, without having to worry about padding shorter numbers with extra zeroes or whatever else. That's great. However, that makes sense in situations where you want numbers that can be any number of digits. On the other hand, KM’s sorting only allows for two digits - well… as Peter cleared up for me in my conversation with him about it, it allows for two characters which means we can mix letters and numbers in order to get more than 100. That’s great, except that KM's sorting is making a significant distinction between letters and numbers (to accommodate the “natural” sorting) which screws that up.

Part of my problem is I'm trying to sort macros within their groups but also have them sorted in their groups even when looking at more than one group at a time. I figured to achieve that I could use the first of the two characters as a group indicator and the second as the order in the group.

I have a lot more than 100 macros I'm trying to do this with, which was why I started that part of this conversation in the first place. Perhaps given this natural sorting problem I could use just the 26 letters, but I have more than 26 groups, and a few of my groups have more than 26 macros. Base 36 (10 digits + 10 letters) was going to be enough but this "natural" sorting screws with that.

Ok then I remembered that in my email exchange with Peter, he'd mentioned that "even with just letters and numbers, there's nearly 4,000 combinations. How did he get that (because 36x36 is only 1296)? Ah... 10 digits, 26 lower case letters, 26 upper case letters: 62x62=3844. Fair enough, Ok, let's leave out the 10 digits and work with 26 letters both lower and upper case. I get 52x52 = 2704, though more importantly it means I get 52 groups of up to 52 macros each. More than enough for now.

Ok, so consider my "digits" to be either:
aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
or
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ

Wasn't sure which it was so I started testing both. I'd expect I should be able to work with those 'digits' as if it's base 52. Except neither list of digits works reliably! The sort order appears to be:

aa, aA, Aa, AA, ab, aB, Ab, AB, …, az, aZ, Az, AZ, ba, bA, Ba, BA, …

To get the sort order required, I have to ... well... honestly I can't seem to figure out a suitable algorithm - at least not one that allows me to have 52 or 62 distinct groups per the first character. There is logic to that ordering, but it's kind of in groups of four and certainly not the same logic that any English or western counting system uses.

So, admittedly, I’m a little frustrated at this point because I’ve spent days on this to finally get to this point and still not have a solution to my problem when really I’d have thought it was a pretty simple problem (put a number or character combination in front of a string of text to sort it sensibly). Perhaps I have an edge case here in some of the specifics - so maybe it's too much to ask for Peter to adjust KM's inner workings to accommodate this, but then is it really that edge? I have to wonder if there's anyone else out there trying to sort more than 100 macros in certain way and trying to programmatically re-name them to achieve that.

Ok, what am I hoping to achieve from this post? I'm not just trying to rant about my frustrations (I apologize if it does, but I've put some time into trying to identify and clarify the problem, so I hope that's worth something). I guess ultimately I'd welcome anyone with any insights into this.

Is anyone else trying to do anything like this? Perhaps, are there enough people trying to do anything like this to warrant Peter putting the work into some update to how macros sort? Or... is there something I've idiotically missed that should make this a lot simpler than I'm currently seeing? Or... am I just going about this the whole wrong way, perhaps trying to solve the wrong problem?

I'd welcome any insights. Thanks in advance!

First, I'll admit your post is far too long for me to study. But I did scan it.

Stepping back, I guess my first question to you is, do your really want and need to have a pallet with > 100 Macros? Is even a 100-macro pallet really usable?

It certainly would not be for me. I can't imagine having to read 100 lines every time I wanted to execute a macro.

IMO, using a Trigger by Name Macro makes for more sense for a long list of macros to consider. Especially when you consider that with the careful use of keywords (think text tags) in the name of each of these Macros, you can do a multi-level filter.

For example, I have a lot of Global Macros. Let's say I want an Evernote related macro, but I don't remember the exact name. No problem. I start with a filter of "@en"
and I quickly filter my long list down to:

image

I could continue add additional filter "words", like "note" or "forum" or "search", etc.

This uses the MACRO: Execute Macro by Name (Spotlight) by @DanThomas

Hope you find this helpful.

1 Like

A post was split to a new topic: macOS Big Sur Issues with KM Palettes

Hello @DanThomas,

Thanks again for making all these wonderful macros.
I have two questions:

  1. Is it possible to delete the numbers once the numbers have been added to the macros?
  2. Is it possible to add first 1-9, and then a-z as prefix to the macro names, so that I can use them to quickly trigger a macro in a conflict palette?
  1. Deleting the numbers defeats the purpose - that's how KM keeps them in order.
  2. It might be possible, but I'm not going to do it. :stuck_out_tongue:Sorry.

Hello @DanThomas,

  1. That is because for whatever reason, some people wanted to clear the ordering.
  2. No problem and no need to be sorry. I'm already very grateful for what you have shared to all of us. I was just wondering maybe there is already a convenient way to do it.

Ah, that makes sense. I had slightly misunderstood the question. Same answer as #2, though. :smirk:

Hey @DanThomas, I'm having troubles enabling this macro. I've seen a comment that said to hit edit mode and it doesn't do anything. What am I doing wrong?

The first thing that comes to my mind @Skitzo is that the macros are not really selected (grayed out).
The Organizer macro only works when the macros are correctly selected (highlighted in blue), as in my example here:

2021_02_12_Support_1

Confirmed. They must be "blue" (or whatever color it is on your system). Thanks for figuring it out!

1 Like

Thank you for you help!

It turns out that the macro was disabled and I was trying to launch it. That seemed to have done the trick. I feel so stupid.

No, you don't have to. We all have one of those days where the simplest things are not obvious :wink:

I have found that you can also use letters in the prefix and even punctuation characters (but not spaces or )). Sort order in KBM is not quite what you might expect, e.g., 4a) comes after 04) and not between 39) and 50). 10 numerals plus 26 lower case letters plus 26 upper case letters plus maybe 10 punctuation symbols (I haven't exhaustively tested but period, comma, ampersand, exclamation point, and backquote all work) is approx. 72x72 or over 5000 possible palette entries. I haven't tried to see if maybe only 67 of those can be used at one time.

Yes, you are correct about technically being able to use all those values. But Palette Organizer only supports 00-99. And no, I don't plan on changing it any time soon, just in case you were wondering. :grinning_face_with_smiling_eyes:

I don't expect you to.

After I wrote my note above, I found David Thorpe's comment from July 2020 about the sort order of alphabetically named macros. I particularly appreciated his comment about getting up to

That's what the extra names mean to me, ways to group macros rather than simply order them.

Unfortunately, he also discovered that

which messes up my "intuitive" notions of grouping.

There are many more ideas in this thread than I found in my first skim!

Thanks.

Mine too! :smile: