It's an amazing and informative utility. The program outputs the size of each macro in bytes. But I have two questions: (1) does this include the data used by images within the macros? (2) how would I estimate the "percentage" each macro is using rather than each macro's total bytes? Perhaps what I want to know is: what's the easiest way to add up the numbers from your output?
Yes, it includes all that info. As for what's the easiest way to add the numbers up and figure out percentages, sounds like a job for a spreadsheet. Should be too hard, since the data is tab-delimited.
I have a 5 megabyte macro which contains an action with a text constant that's 4.5 megabytes in size. I suppose I should store the text in a file instead, and read it when the macro initializes.
Obviously I created that large macro intentionally, but I forgot about it, so this utility is helpful for me to spot my biggest mistakes.
Since this produces no output at all on my system @DanThomas I assume it requires Monterey? Is that correct?
KM Log contains:
2022-02-11 13:29:32 Action 526658 failed: Execute a JavaScript For Automation failed with script error: text-script:3096:3148: script error: Error on line 90: SyntaxError: Unexpected token '?' (-2700)
2022-02-11 13:29:32 Execute a JavaScript For Automation failed with script error: text-script:3096:3148: script error: Error on line 90: SyntaxError: Unexpected token '?' (-2700) in macro “List All Macros By Size” (while executing Execute JavaScript For Automation).
I know but sometimes Dan needs a break. I hesitated to even respond that it wasn't working for me as I tried it several times. Since it works for others, there must be something crazy about my system. I truly don't want to occupy his time. I'll miss out on this one and it's ok.
The Variable Inspector Prompt is that large because it has the HTML in one of the actions. You can actually put the HTML in a file if you want to. At the end of the macro 45)[VIP] Setup Variable Inspector Prompt - Advanced (Subroutine) is this code:
Take the HTML from #1 (above) and put it in a file. Set variable #2 to the file path. Then, at the minimum, delete or clear out #1.
As for any of my other macros, delete the icons - that's usually where the size comes from. Especially in things like KMFAM, which has icons on a lot of the individual macros, and the group.
(And I know you weren't necessarily complaining, but since I have a solution, I thought I'd mention it.)