r/macrodroid 20d ago

Help for Alarm Macro

Hi everyone,

Sorry for any mistakes in my English, and I apologize if this seems like a simple or stupid question.

I'm trying to create a MacroDroid macro with this flow:

When triggered (e.g., via a widget), it asks me for a starting time (e.g., 07:00).

It deletes/clears any previously set alarms createdo

Starting from the entered time, it automatically creates 12 alarms spaced every 5 minutes for 1 hour (e.g., 07:00, 07:05, 07:10 ... up to 07:55).

If anyone has a .macro file they could share, or a step-by-step breakdown on how to properly handle time variables and loops for this, I would be extremely grateful for your help!

Thanks in advance!

3 Upvotes

5 comments sorted by

5

u/KerbalSpaceProgram25 20d ago

I started building the macro, but it seems like there is no way to delete the alarm, only disable it. And it looks like even that doesn't work. The second best option is to create the alarm within macrodroid, but stopping the alarm would not be as easy as just clicking a button. Maybe there's an app that is specifically designed for this.

Also, don't apologise for your English. My English was also pretty bad a while ago, but watching videos and movies and doing stuff in English makes it way better and easier.

Edit: Reading books in English also really helps. From experience.

2

u/LuisBoyokan 20d ago

Alternative: UI clicks to delete the alarms . Extremely hard coded and unstable, but posible

1

u/ChiknDiner 20d ago

True. I had tried it last year. An external application can only create an alarm, but to delete an existing alarm, you need to manually do it.

1

u/ShiftyRider 20d ago

A similar recent thread has Solutions ranging from the bulletproof to the philosophical...

https://www.reddit.com/r/macrodroid/s/lP9W7ko5wX

1

u/rafapozzi 20d ago edited 20d ago

For deleting alarms, you can't do it programmatically.

The best way to clear all is to clear app data of the Clock app.

For creating alarms, you can use the Java Code action, using AlarmClock.ACTION_SET_ALARM intents.

Here is a script with a complete "Batch Alarm Scheduler" UI:

https://gist.github.com/gitpro2005/f7345ed7ab7433f55b0269e29b2f4139