Wait for macro to be invoked action

chaoscreater

Active member
There is a Wait for Trigger action, but I'd like to have a Wait for Macro Invoked action as well.

If you have 2 macros, where they both use the same trigger (e.g. Wifi Connected), then they could both fire at the same time. Sure, you can probably use Run Macro to make the first macro run the 2nd macro, but sometimes that's not ideal, especially if you only want the actions of just one of the macros to be performed, instead of actions from both macros being performed.

Basically, whenever there is a race condition, having a Wait for Macro invoked would be handy.
 

chaoscreater

Active member
你用一个宏发送一个意图,将两个要同时触发的宏触发器设置为接收到这个意图不就好了
No idea what you're talking about. Google translate doesn't make sense.

Both macros use the same trigger (Wifi Connected). I'm aware you can combine 2 macros into one, but I don't want that. I want to keep the macros separate so it's clean and easy to manage. Combining too many different macros into one means that you can potentially have a very complex macro that requires a lot of different conditions to check. Having a "Wait for Macro invoked" would be so much nicer.

Also, depending on the situation, macro 1 may need to run before macro 2, but sometimes macro 2 may need to run before macro 1, or something like that. So you'd definitely need to have some sort of "Wait for macro invoked" feature to achieve this easily and cleanly.
 

chaoscreater

Active member
(I used DeepL, it makes more sense : You use a macro to send an intent, and set the two macro triggers to be triggered at the same time to receive the intent)
Why would I need to send an intent? It doesn't make any sense and it's unnecessary.

When I'm connected to a Wifi SSID, that is the Trigger to use. I don't need to manually send an intent just to trigger something.

More importantly, I don't have a problem with the 2 different macros being triggered at the same time. The question was about how to make the macros run in a specific order that I want.

Trigger: Wifi Connected

Macro A needs to run before Macro B.

OR, depending on the situation, Macro B needs to run before Macro A.
 

420

Active member
I think it's an interesting idea, but how would a "wait for macro to be invoked" action help you though? Because as you say they would both invoke at the same time. Surely in this case the action would always be "true" and it would never actually wait..?

Would it not be easier to use a boolean to determine which of the two macro's should run first? Having an if clause at the top in both macro's, in one it waits 1 minute if the boolean is true, in the other it waits 1 minute if the the boolean is false? This won't let you run them simultaneously though, not sure if that is ever required, if so you could use another type of variable.
 

420

Active member
Maybe instead of a boolean or other variable you can use your specific situation as constraint directly in each macro? I'm not quite sure what your situation is.. For example in macro one you have a wait action at the start with constraint "phone is locked", in the other you have a wait action at the start with constraint "phone is unlocked"?
 
Top