What would be really nice is to be able to go right to the problem action.
So here's what I'm thinking.
At the minimum, a new token like %LastExecutedActionUID%. Then we could use some AppleScript to execute the KM Editor's "selectAction" command, passing that UID. We'd have to store the value immediately after the action we're concerned about, to potentially use it later, but it would be doable.
Better still would be a "Gear Menu" option to store the action's UID, so it would be available in a token of some kind. That way when we execute an action that we'll need to check the result of, and possibly display an error, we'll have the Action's UID available.
Just a thought. It may not be relevant to a lot of macros, but I have some macros that are pretty extensive, and it would be nice to go right to, or near the problem.
That's pretty cool! But isn't that only if KM aborted the action?
What I want is this: Let's say I have a subroutine that validates its parameters, and if they're not all correct, it display an error message. The token you mentioned won't be relevant here, because it's not a KM error.
Does that make sense?
And thanks for the comment - I appreciate any help I can get!
Ah … okay, I get it … you’re asking for a easier way so that Macros can validate them self and notify the user if anything goes wrong. Or doing something else what ever will be possible with this Token.
Yes it now makes sense to me … I think it’s actually a pretty darn cool thing you want to have … I like that …
There is something that you could do in extensive Places until then … hardcoding the ActionID and try to find a way using this approach… that’s actually something that I try to do in some of my Macros but I don’t have something that would be usable yet.
You’re welcome - I try to give my very best to help you and giving something back.
Actually, yes, I could probably do that. I already have plenty of code to get the id of the action, and a simple applescript can get me back there. The potential downside is that if I'm working on a macro I intend to share, the Action ID can definitely be different, since they're not unique like UUIDs are.
Yes that’s true but I maybe have you covered on that for the future in my Feature Request linked down below where I ask for a %RandomActionID% Token to catch up on that. I’ve included this one into my Whishlist and posted the request after my last reply in this thread.
By building an Installer routine into your Macro like you did for KMFAM you would be able to use this token and there would be no Problem.
Personally, it's not something I need. I would never write code that would be tied to a specific action UID. There's nothing wrong with getting the UID of an action at runtime and using it within the lifetime of a macro instance, but I would never write code that relied on a specific action UID. Since it's a number and not a GUID, by definition it can change from system to system.
If there was ever a reason I needed to do something like that, I'd generate a UUID and put it in the action's "Set Note", which I could then search for if I really needed to, and get the Action's UID at that time. But like I said, this isn't something I need.
Yeah, I understand that… but that’s the thing why I want to have that Token - it would run an extensive amount of code to make it easy getting the Numbers that aren’t used on that particular system. These could than be tracked in the Macro and you then could your requested token for checking every Action.
Therefor it could be unique since you’re able to get Name of the Action. Any way or you build something that uses the Actions Name hardcoded to inform the user about the correct Name.
This way you could use a button in your Prompts to copy the Message to the clipboard or create a message on the dedicated Macro thread here on the Forum with the Action Name included.
If you build something for yourself that catches this Action name and uses the ActionID of our system you’re good to go for helping out on the issue.
I know this sounds bad because it’s a lot of work - but it would be able to payoff afterwards.
And it doesn’t matter that the ActionID‘s are other Numbers on other Systems.
I’ll go to sleep now … it’s past 3 o’clock in the morning here … 30 hours of no sleep are enough…. I think I must stop it beeing awake for such long periods.
@peternlewis In case my request got lost in the noise, I'll repeat it.
I'd like a token something like "%LastExecutedActionUID%". Or even "%ExecutingThisActionUID%".
I'm working on a complex set of macros, and it sure would be nice to be able to display a message, and be able to jump right to the point where the message is displayed.
So the above would facilitate that. Or an action like "Edit This Action".