How can i make this macro? Is it even possible?

Hey everyone, so for some time i have been wanting to create a macro for a thing that i do, which is i usually listen an audio, and i have to listen to it for specific amount of time, like 1 hour a day for example, and so i use the google clock timer function to track that, and it's not bad, but there is an issue that bothers me and i think it could be fixed using a macro.

Like everytime i am listening to that audio and i use both earbuds when doing so, when someone comes to talk to me i have to tell them to wait a sec for me to pause the timer and the music player from the notification bar, and yes i could do this no problem, but it's annoying having to make people wait for me to pause both apps in order to listen to them, because it takes me a few seconds to this.

So what i want to do is make a macro where everytime the music is paused, the google clock timer is also paused from the notification bar, using the notification interaction action, BUT i would want it to only perform the action if in the notification bar the text it contains is "Pause" not "Resume"

I have tried doing this but it did not work, i will leave some screenshots so ya'll can tell me if i did something wrong or not.

So i am leaving here, a screenshot that shows what is the text from the notification i want for it to contain in order for the action to be performed.

Then there is a screenshot of what i tried to do, putting in the "Text Content" area the word "Pause". I did this but it didn't work when i paused the music.

The last screenshot is the whole Macro i tried to do, it did not do anything when the music was paused.

Is there any way to make this macro? Thanks.
 

Attachments

  • Screenshot_20231008-114828_One UI Home.jpg
    Screenshot_20231008-114828_One UI Home.jpg
    29.8 KB · Views: 14
  • Screenshot_20231008-114959_MacroDroid.jpg
    Screenshot_20231008-114959_MacroDroid.jpg
    201.4 KB · Views: 14
  • Screenshot_20231008-115039_MacroDroid.jpg
    Screenshot_20231008-115039_MacroDroid.jpg
    269.5 KB · Views: 14

hsurB

Well-known member
Maybe phrase 'Pause' isn't recognized from notification as its one of actions. Do You often pause the audio when google timer isn't runing? Could You also provide screenshot of notification when timers is stopped?
Macrodroid has built in fuction called stopwatches. Have You considered using it instead google timer?
 
Last edited:
Maybe phrase 'Pause' isn't recognized from notification as its one of actions. Do You often pause the audio when google timer isn't runing? Could You also provide screenshot of notification when timers is stopped?
Macrodroid has built in fuction called stopwatches. Have You considered using it instead google timer?
Well, i never understood how Macrodroid stopwatches work, like i need a timer that gives me a notification or vibrates/rings once the timer it's over, do Macrodroid stopwatches do that? If yes, how do i setup one?
 

hsurB

Well-known member
You can use makro like that. Its simple just for you to get an idea of how to use stopwatch.
You need to remake it for your preference and upgrade.
You could even update macrodroid permanent notification to update each second and use stopwatch in it, then it would show it in real time, just like your timer app.
Edit. Also lets say you listen to audio for 1h/daily. You could add action to stop and reset stopwatch as soon as it reaches 1h (3rd if clause) - before or after displaying notification. this way stopwatch doesn't need to be manually reseted and its ready to be used the next day.
 

Attachments

  • Audio.macro
    3.7 KB · Views: 2
  • Audio.png
    Audio.png
    274.7 KB · Views: 17
Last edited:
Damn! I will try that, it seems like a very good and smart idea, i am such a beginner to Macrodroid, i could never come up with the idea of such a macro, thanks i will try and report back!
 
You can use makro like that. Its simple just for you to get an idea of how to use stopwatch.
You need to remake it for your preference and upgrade.
You could even update macrodroid permanent notification to update each second and use stopwatch in it, then it would show it in real time, just like your timer app.
Edit. Also lets say you listen to audio for 1h/daily. You could add action to stop and reset stopwatch as soon as it reaches 1h (3rd if clause) - before or after displaying notification. this way stopwatch doesn't need to be manually reseted and its ready to be used the next day.
Also btw, how do update macrodroid permanent notification?
 

hsurB

Well-known member
Its Set Macrodroid Notification Text action -> Custom text. After clicking ... you can use created stopwatch in notification.
But to create something like timer notification you need to create a loop inside macro that will be updating notification each second.
Action: Repeat actions - do once and repeat while condition - this macro enabled (for exemple).
Inside the loop set macrodroid notification text action (as above), wait before next action - 1s. And You need another macro to enable/disable this macro with loop
 
Its Set Macrodroid Notification Text action -> Custom text. After clicking ... you can use created stopwatch in notification.
But to create something like timer notification you need to create a loop inside macro that will be updating notification each second.
Action: Repeat actions - do once and repeat while condition - this macro enabled (for exemple).
Inside the loop set macrodroid notification text action (as above), wait before next action - 1s. And You need another macro to enable/disable this macro with loop
Could you send me a screenshot of this whole macro done or the file? I tried to do it but once i put the music playing the phones says what is being said in that screenshot.
 

Attachments

  • Screenshot_20231008-163611_Music Player.jpg
    Screenshot_20231008-163611_Music Player.jpg
    46.3 KB · Views: 10

hsurB

Well-known member
Test it and let me know if it works
 

Attachments

  • Audio.macro
    4.7 KB · Views: 4
  • Audio1.macro
    1.6 KB · Views: 3

hsurB

Well-known member
Hey, i tried both macros but there did not appear any notification of MacroDroid stopwatch in my notification bar.

This macro edits macrodroid's permanent notification thats visible when macrodroid is enabled. Maybe you disabled it.
After enabling it again you need to restart macrodroid to see it
 

Attachments

  • Screenshot_20231009_034414_Settings.png
    Screenshot_20231009_034414_Settings.png
    262 KB · Views: 9
Last edited:

hsurB

Well-known member
It should appear in this notification.
Can you try expanding this notification to see if its there and update macrodroids system logs? I honestly have no idea why wouldn't it work but we'll find out
You can also check if theres stopwatch in main menu/stopwatches. I guess its exported with macro but who knows

 

Attachments

  • Screenshot_20231009_162048_Opera.png
    Screenshot_20231009_162048_Opera.png
    727 KB · Views: 6
Last edited:
That's the notification i fuckiiing want lol, idk why it doesn't appear to me, is it because i have android maybe?

I will try the other steps you suggested
 

hsurB

Well-known member
Confirm its not there when you click the arrow, please.
If its not there update screenshot from macrodroid logs after runibg macros for few seconds.
What version of android are you runing?
Also do you have any buttons added to notification? (Look second screen)
 

Attachments

  • Screenshot_20231009_162048_Opera.png
    Screenshot_20231009_162048_Opera.png
    222.4 KB · Views: 5
  • Screenshot_20231009_164849_MacroDroid.png
    Screenshot_20231009_164849_MacroDroid.png
    179.6 KB · Views: 5
Last edited:
Hey so i turned off the button bar option that was enabled for me, and when i click in the arrow there appears a stopwatch called "Timer" BUT i don't have any stopwatch called timer in Macrodroid anymore, i had one with that name but not anymore.

My current stopwatch name is ListeningAudio and that one isn't the one that shows up in the notification bar.
 

Attachments

  • Screenshot_20231009-163839_One UI Home.jpg
    Screenshot_20231009-163839_One UI Home.jpg
    19.5 KB · Views: 3

hsurB

Well-known member
Yeah. So it all works now. If you try to configure action set macrodroid notification text you will see I put the word Timer there its like a title for notification but it uses ListeningAudio stopwatch. You can now edit trigger to display notification when stopwatch reaches time you want (right now it does after 1h), and you can add action so the stopwatch stops and resets after reaching this time as well so it was ready for the next time.
 
Last edited:
Ok bro, thanks a lot!

Juat one more question, when i reset my timer, for whatever reason, the timer notification still shows the time it was in before i reset the stopwatch, it did not update why is that?
 

hsurB

Well-known member
Cause based on these two macros currently the notification is being updated each second after any music is started. Add set macrodroid notification text -> custom text and leave both blank to hide the timer from notification (for exemple add it in 3rd if clause, the one with actions when the timer gets to 1 hour).
It should look like that:
Display notification
Stop stopwatch
Reset stopwatch
Set macrodroid notification text - Custom - Both titile and notifcation blank (without a loop obviously)

This way your notification will look just like that from my last screenshot that I have updated here and timer in notification will be visible only after you start playing music and when stopwatch didn't reach 1 hour
 
Last edited:
Top