Ok I'm just spitballin' here, and this may be something nobody's that interested in, but hear me out...
You're developing a macro and you upload it to the forum. You know it's still not quite there yet, so you title it My Cool Macro v1.0 and add this little macro group at its start:
Another forum member downloads your macro. Each time they run it, it checks to see if it's been updated in the original forum post it was downloaded from.
If it has, the user is prompted to download the latest version:
It requires you to publish the forum post in order to retrieve its post URL and add it to the macro as a variable before you actually upload the macro to that post. A bit convoluted!
I opted to run the update check as an async submacro, to avoid delays to the execution of the macro in question. The down-side is that the user will have to have downloaded it. An alternative would be to include the checker as a disabled in-line action group that the user would manually right-click and Try, to check for updates explicitly.
We would obviously want more options in the user prompt. Don't ask me again, for example.
Anyway, if you have any thoughts on this idea, let me know. It might not be worth investigating further, but I've often wondered if there might be a more elegant solution for keeping macros up-to-date.
That’s a very good idea. However, I wonder (without having thought through any implementation details) whether the problems that you mention should just be avoided by using a repository for such macros outside the forum. That is to say, the forum is almost certainly not ideal as a software archive.
The thought had crossed my mind, but a user might delete macros hosted on GitHub/Dropbox, etc, which isn't great for future referencers.
I suppose, in an ideal world, we'd have a shared KM repository, with versioning. Perhaps that's possible with GitHub, but Peter would have to design an interface.
Then there's still the issue of how to check for those updates. This method works, but it's a bit fiddly.
Not entirely accurate. You should be able to use a KM action to call a macOS shortcut with the following action, and then filter the result that's returned to the KM action to get the answer.
You may need to use the ChatGPT model (because the default model may not work.) However I will point out that the result returned in this specific case doesn't include the correct answer. I'm not sure if that's a temporary problem or not. In theory, this should work. Maybe if you reword the question a little better, you could get the correct answer.
I recommend that people on this forum try tinkering with the wording above to get the correct answer. My results differed each time I tinkered with the wording. With the right English wording, you may be able to solve this problem.
I actually have an update checker in a few of my more regularly-updated macros. It stores the macros on my personal server, and a hash value on Github—that way, if someone gets to my personal server and hacks a macro, the update will fail unless they also manage to hack my Github and update the hash values. And honestly, I don't see that being anywhere near worth the effort required.
I posted a working sample version a long time ago; I'm still using that basic updater today. While it's not quite as fiddly as yours, it requires a pretty steep technical learning curve, and you have to update a number of items each time you update a macro.
In short, it's far from perfect, but it works reasonably well for my needs.
My initial post here wasn't entirely informative. I didn't make one thing clear: The address added to the Macro Forum Post URL action needs to link to the actual comment that contains the macro, not just the thread that contains that comment.
It accepts .kmmacros and .zip. It's not fool-proof though - if the linked post contains multiple macros with differing version numbers, it will get confused. I think this is potentially acceptable though, as the user will be aware of this limitation when they decide whether to include the update checker in the posted macro. We could potentially make it more robust by checking for the macro name too. I was aware of this, but decided that, for ease and clarity, checking for the version number only would be neater and sufficient in most cases.
That looks like great work, and probably a lot smarter than my efforts here. I suppose there's still a conversation to be had about making something that the average forum member could use without needing external repositories, but I'm not sure there'd be much uptake, even then.
Oh, I see. Well, I don't see why an AI model can't take you to the actual comment. But as I showed, it's not getting the right link at all today. With a little massaging I might be able to get it to work, and even bring you to the actual comment in the thread.
You might get it to work with some trial and error, but the prompt would need to be carefully crafted for each macro and there are too many variables for it to be reliable or universally applicable for each macro in each comment of each thread.
Yes I agree it won't be 100% reliable, as my current results have already proven. But I was also thinking that when you originally write the macro, you could put a unique string into each version the macro, which AI or a general web search might be able to find. Anyway, I admit my proposed solution isn't working today, so that's not a good sign.
Because Keyboard Maestro macros do not themselves require access to the Internet, it might be wise to handle cases where the user is not online (silently die perhaps).
This is likely not as broad as you were thinking @noisneil, but here's one possibility that would well work with my Macro Library contributions since I normally update the thread title with the latest version information, e.g.,
MACRO: Augment or Transform Text, v8.0
Here's an example macro with a different (presumably newer) version available...
Seems like we've been thinking along the same lines, but you took it a bit further than I did. Good stuff!
So how did you get around the thread/comment creation paradox? Unless you're posting a macro in an existing discussion, no thread number exists at the time of upload.
Thanks for that! So yeah, basically you do it exactly the same way, but with way more attention to detail. Love the formatting of those help prompts by the way!