MACRO: A Macro to Track Macro Usage

Neat! Adding this to a few macros to have a new way of viewing the data.

Actually added to more than a few. @_jims - the insertion hotkey ⌃⌥⇧= was a delight to use.

Also the macros are well sorted (noticed the trick using in macro names). Best to disable "disabled to bottom" in View > Sort Macros By :slightly_smiling_face:

Thank you!

Installation instructions:

ignore mostly everything except inserting the macro action, wait a few hours, get notified you forgot to finish installing and...

It remembered anyway.

This is better than most consumer products, what y'all are up to with the robustness of this and other top-tier macros.

Hi there, I was wondering about usage report and came across this post. It was a great macro but I felt a bit lazy to add the action to all my macros. So I went to v0 and crafted a small web app, hopefully is useful not only for myself :smiley:

Source code here.

1 Like

Your second link is currently defective.

I personally would not recommend that anyone upload your KM log files to that external website. Log files can contain a wide variety of private information.

Your second link is currently defective.

Oops. Forgot to turn the repo public.

a wide variety of private information.

Perfectly fair, I would share the same concern. Feel free to take the code, and use at your own risk. :slight_smile:

That's very humble of you. And you make a good point. I just don't have the skill set to review your code.

1 Like

On the second link are instructions to run it locally on your Mac, which is what I used. Note that this requires installing bun, which you can do via Homebrew:

$ brew tap oven-sh/bun
$ brew install bun

Once installed, I just ran the commands shown in the "run locally" section of the source code page, and had a copy running on my Mac. Dropped my log file on it, and ... it's really slick! The keyboard hot map and time analysis tabs are really cool.

It'd be useful to be able to exclude macros by name or regex pattern; I have some that run dozens of times a day, and they completely distort the totals, because their usage is in the tens of thousands of times. Would that be possible to add?

-rob.

Ok, maybe I was slightly paranoid, but paranoia is how I made it over 40 years in this business without ever being infected by a virus or malware. Even during the Windows era.

I think your paranoia is merited, and I'm quite similar. That's why it was nice to find the "run locally" option. And while I can't parse all of the source code, I did dump the project into BBEdit and search for "https", and found no matches—so if it's doing something with the data, it's doing so in a more-involved manner.

I also looked at the actual source files, and while I couldn't write them myself, reading them is pretty easy in terms of generally seeing what's going on. I certainly didn't see anything obvious that looked malicious. (Granted, it wouldn't take much to obfuscate such things from me.)

-rob.

Okay. That's great to hear. The peer review has begun. I'm not feeling as scared as I was when I first read the post. Odds are now leaning in the direction that it's good code.

Glad to hear that!

search for "https"

Good job :slight_smile: Alternatively, you could also skim through pakcage.json (could do with LLMs), if any suspicious packages (not commonly seen) are added. Malicious code can be hidden there.

exclude macros by name or regex pattern;

I added filter options in the table, you can click the filter symbol in column header, there are options like contains / not contain .. AND / OR, hopefully is enough. Regex will be trickier.

Additionally I just updated with:

  • Pie chart switch
  • Table in Time Analysis tab

Enjoy!

The fact that you yourself would point out a method where code could be hidden tells gives me even more confidence in your code that I had earlier. In fact, some malicious code could be inserted unbeknownst to the programmer himself through libraries and whatnot. It has actually happened before (not related to KM.)

KM is one of the few products from small companies that has earned my trust. I think the first version of KM that I purchased was on the Mac App Store, but that was before the App Store had Privacy statements. I don't think KM currently has a Privacy Statement like App Store apps have, but I did find a post from The Architect that is quite similar to a Privacy Statement....

That sounds like a pretty good privacy statement, but I don't think it's entirely complete because once a month I get a crash report from KM that asks if it can send the report to company HQ, and I'm guessing that report could contain some sensitive data, like hardware details of my Mac.

2 Likes

That's perfect, thanks! Very nice work!

-rob.

2 Likes