I've been wondering about this since launch, but have no impressive examples myself. I've been able to drop macros like [KM] Put Selected Actions into Group Action in favor of the new Engroup feature, etc., but I'd like to see what improvements y'all have made.
These will help insure that variables are used/set only where they are intended to be used, and to greatly reduce the variable clutter caused by Global Variables.
I expect to rewrite many of my macros using these.
However, I'm waiting for the new prefix character to be established, and I also hope that two underscores will be supported in addition to a space in the prefixes, as in "Local__" and "Instance__"
The New "Always Activated and ..." Option for Macro Groups:
.
This is really huge, and makes use of Palettes, IMO, much much more powerful.
We can now have BOTH:
Individual Macros always active and can be triggered any time
Show a Palette for the same Macro group when we need it.
For example:
.
.
(Note to @peternlewis: is this new feature documented anywhere in the Wiki? I couldn't find it.)
And I am sure there will be many more. That's all for now.
All right, here's the best (read: only, at least for now) example I have to share. Background: a few months ago, I made a thread asking for help with a date converter macro, which in turn led to this thread where Peter teased an upcoming KM8 improvement that promised to make this surprisingly tricky task considerably simpler. Now that KM8 is here, I was finally able to take a crack at streamlining it and seeing how much simpler I could make it (spoiler: quite a lot simpler).
To put that in number form, the original macro used 25 actions and 4 variables altogether, and the KM8-optimized one uses 9 actions and zero variables. The new version achieves this entirely thanks to KM8's ability to use regex matches and capture groups in tandem with the %Calculate% token, especially the new %CalculateFormat% token (without which the date conversions couldn't be formatted properly). These new abilities also completely eliminate the need for the original's For Each loops and variable "placeholders" (which were used in the original version to ensure that only one matching pattern at a time was used for calculation and replacing) as the necessary calculations can now be searched, done in-place, and written back en-masse.
I doubt this particular macro will be very useful for anyone who doesn't regularly work with Japanese dates, but hopefully this helps show what KM8 makes possible
It seems my âIIRCâ was wrong. Canât make it work with KM7. Must have mixed it up with some other thing.
And, before you ask: Yes, I still have one Mac with KM7 running. Shame one me. But the sole purpose of that KM7 Mac is to verify whether something I perceive as new with KM8 really is new. Or vice versa
â
Here is an example of mine how I used the new KM8 features in a macro:
Version 7 would process the tokens of the replacement, but only once before the search & replace started.
Version 8 processes the token for each replace, allowing you to use the results of the match as part of the replacement, changing the replacement each time.
Was able to drastically pare down and improve a macro I came up with a few months ago for searching text files and displaying results thanks to Prompt With List: