How to stop or toggle off a macro

anandaruchira

New member
Newbie here. I set up a macro to play every morning my chosen music (20 min). That's easy. But I realize there will be occasions when I need to turn off the music before the music finishes. I can't figure how to create a macro, or button, or constraint that'll do this. Please help
 

hsurB

Well-known member
You select any trigger you want to do this and use cancel macro actions (thats how the action is called) and you choose macro from the list that appears
You either do it in the same macro using if clauses (trigger fired as constraint) for each trigger or in another macro
 

hsurB

Well-known member
I attached screenshot.
First you create if clause with trigger fired day time trigger and add your actions and later you click the first action (the one with if) and click add else/if clause to add another one with constrain trigger fired floating button (thats what I used as trigger to cancel, you can choose whatever you want) and add action to cancel this macro.
Make sure BLOCK NEXT ACTIONS in play sound configuration is unchecked as it could block the macro from cancelling itself I think (unless you are playing music with different actions) - then it might require action control media to stop it.
If cancel macro actions doesn't work on play sound action (I dont see why it wouldn't but I didn't test it, you could always enable and disable macro with actions - it requires two macros since disabled macro cant enable itself)
 

Attachments

  • Screenshot_20240205_224219_MacroDroid.png
    Screenshot_20240205_224219_MacroDroid.png
    343.3 KB · Views: 16
Last edited:

Dm114

Well-known member
I attached screenshot.
First you create if clause with trigger fired day time trigger and add your actions and later you click the first action (the one with if) and click add else/if clause to add another one with constrain trigger fired floating button (thats what I used as trigger to cancel, you can choose whatever you want) and add action to cancel this macro.
Make sure BLOCK NEXT ACTIONS in play sound configuration is unchecked as it could block the macro from cancelling itself I think (unless you are playing music with different actions) - then it might require action control media to stop it.
If cancel macro actions doesn't work on play sound action (I dont see why it wouldn't but I didn't test it, you could always enable and disable macro with actions - it requires two macros since disabled macro cant enable itself)
To be sure music will stop when macro is cancelled, you could add a Play/Stop sound action prior cancelation.
 

anandaruchira

New member
Did it! I found "cancel macro" did nothing. Then I discovered (before seeing above) that "stop sounds" is exactly the right one. Thanks again for your guidance. See below pics. (Note: in my macro I purposely have "volume up" twice.
 

Attachments

  • Screenshot_20240205-162613_MacroDroid.jpg
    Screenshot_20240205-162613_MacroDroid.jpg
    295.5 KB · Views: 13
  • Screenshot_20240205-160113_MacroDroid.jpg
    Screenshot_20240205-160113_MacroDroid.jpg
    169.8 KB · Views: 12

Dm114

Well-known member
Did it! I found "cancel macro" did nothing. Then I discovered (before seeing above) that "stop sounds" is exactly the right one. Thanks again for your guidance. See below pics. (Note: in my macro I purposely have "volume up" twice.
You're right: Cancel action is not really useful as there are no actions running after Playing music.
 
Top