Earlier tonight I posted, then removed, a macro that tracked macro usage. The macro itself works great, that's not the problem. The problem is that the way it has to work seemingly makes it basically impossible to ever replace—I can edit mine just fine, but if I distribute it, and someone already has the macro installed, all sorts of heck will eventually occur.
Here's the problem I'm trying to solve: I need to get the UUID (and name, etc., but if I can get the UUID, I can get all of that) of the user's macro that is to be counted. In my current version, it works in this manner:
User's macro: An action is inserted which calls my count launch macro, which simply gets the %ExecutingMacroUUID%
token (and the other associated tokens. The count launch macro saves these values in a permanent variable, then hands things off to the worker module, which runs asynchronously. (You can't get macro info from the calling macro if the called macro is running asynchronously, hence my two-step solution.)
And while this works great, it means that each macro has a call in it to my starter macro. Everything's going great, but now the user updates my macro. When they do, the original call to the counter will fail in one of two ways. If they left the old version installed, it will call that version (and if it's disabled, the macro will quit itself). That's the better of the two scenarios.
If they delete the old version, then every macro of theirs that calls the counter will fail to run, because the first step tells it to run a macro that doesn't exist.
I honestly don't see a solution to this problem. I thought maybe I could launch by name via AppleScript, and use that as the macro that gets added to each macro. Given a unique name, it should work. However...
If you launch via AppleScript, it appears things happen asynchronously, because the UUID I get back is that of the counting macro, not that of the calling macro.
I'm not expecting much help here, as this is really esoteric, but it seems like it's something that should be doable ... any ideas?
-rob.