igh_033
January 31, 2023, 10:20pm
#1
I'm using a MacBook with clamshell mode.
This action will activate when It plugs my laptop into my monitor at home. This macro will trigger, recognising a USB mic at the home.
But it is inevitably executed twice. So I decided to introduce semaphore lock. But that doesn't change anything. Do you have any idea why?
Monterey 6.2, KM 10.2
Thanks,
Hello,
You should try to setup the timeout of the semaphore Lock to 1 hundredth of a second.
First macro will trigger but every other will abort as soon as they start.
See that in another post in this amazing forum. Hope it helps.
3 Likes
igh_033
January 31, 2023, 10:53pm
#3
Lucien_Keller:
You should try to setup the timeout of the semaphore Lock to 1 hundredth of a second.
First macro will trigger but every other will abort as soon as they start.
See that in another post in this amazing forum. Hope it helps.
Thank you! It works well!!
tiffle
January 31, 2023, 10:58pm
#4
That post can be found here:
A frequently occuring issue (and I have seen the question several times before) is not only preventing multiple instances of a macro running (for which "Semaphore Lock" is the solution), but people ask how to cancel other instances of the same macro, so they don't have to deal with catch-up macros...
A new cancel action of "Cancel all instances of this macro" could help, but there is actually already a way to do this built in!
On the "Semaphore Lock" set the timeout down from 1h to 50 hundreth…
3 Likes
igh_033
February 1, 2023, 12:13am
#7
Thank you for your detailed advice. I will try to change that setting immediately!
Thanks for providing me with the file management macros the other day. I like that macro of yours👍
2 Likes
Tom
February 1, 2023, 2:27am
#8
Some time ago I compared different ways of using Semaphore Lock and Disable/Enable Macro and what they do exactly:
I noticed that the question in your topic title is not the same as the one in your post:
(1) How to prevent a macro from running twice at the same time?
≠
(2) Anyway to prevent the second instance from starting if the first one is already active?
For question (1) the default Semaphore Lock is sufficient: The triggered macro instances will be queued, but each one will run eventually. (One after the other.)
For question (2) you need either…
a Semaphore lock with a very short timeou…
Maybe you will find it useful.
5 Likes
igh_033
February 1, 2023, 10:31am
#9
Thank you very much for your many messages on my small post! Actually, I used your topic as a reference to learn how to use that action. But my English level was low so I couldn't understand it perfectly. But you kindly gave me a supplementary explanation, which helped me to understand better
1 Like