Trigger Value in Semaphore Lock

Just double checking...

If I execute a macro with a parameter (eg. "USERSTEVE") and the first action in that macro I execute is a semaphore lock named "Macro 1 %TiggerValue%" that Semaphore lock should be named "Macro 1 USERSTEVE".

So If the same original macro runs and the parameter is "USERSTEVE" the macro that is supposed to execute will wait to run again if it is still running from before since the trigger value is the same and the semaphore lock is "Macro 1 USERSTEVE".

Can someone verify this? Is there a better approach?

@JMichaelTX
@Sleepy
@DanThomas

Sorry to tag you three, I just know all of you would most likely know and I got a good bit of work to get done. Obviously, that is my problem, not yours, but if you have a moment and see this please let me know what you think! I Appreciate everyone in this Forum! Thanks

Let me rephrase the statement, to make sure I understand your question:

If a macro locks a Semaphore with a specific name, and another instance of the macro (or any other macro, for that matter) tries to lock a Semaphore with the same name, it will wait, timeout, or fail depending on the settings.

So yes, that's what will happen. That's the purpose of a Semaphore.

Is that not what you want?

That is what I want, sorry I am not good at making my questions concise.

Basically, I have several macros that all USE local variables so if every time I need to launch them (asynchronously), as long as the Semaphore lock and trigger value are the same it wont execute or will time out.

I am trying to use the same macros for 5 or 6 different users without having a ton of duplicate macros that are the same.

So, it sounds like that is the best way to do this.

Before I was using the executinginstances token and checking if the uniqe macro ids were in that list or not and then deciding if it needed to execute with an IF.

This is way better though considering I can just execute it everytime and the macro itsself knows to start or to not. Learning process but this is super helpful!

If you're using the semaphore to protect Local variables, you don't need it. The purpose of Local variables is to keep their contents separate across multiple instances. Same with Instance variables, really.

1 Like

I'm not using it to protect local variables, the action that the macro is doing is updating leads in a CRM, so if the macro runs again it will double do things. but THANK YOU! Have an awesome day

Yep, then you're doing it right. Good job - this stuff isn't always the easiest to understand. :grinning_face_with_smiling_eyes: