Run a macro on a specific day

mmjoshi

Member
I want to run a macro on a specific day, say every first Monday of the month at 7:00 PM. Didn't see any action to achieve this. Is it possible? If yes, how?

Using Macrodroid on Android 10.

mj
 

420

Active member
I want to run a macro on a specific day, say every first Monday of the month at 7:00 PM. Didn't see any action to achieve this. Is it possible? If yes, how?

Using Macrodroid on Android 10.

mj
it is possible, and very easy to, just add a "Day of Week/Month" trigger to your macro.
 

420

Active member
it is possible, and very easy to, just add a "Day of Week/Month" trigger to your macro.
oh wait, you want every first monday of the month?? not just a fixed date? that will be harder let me think a bit..
 

420

Active member
I want to run a macro on a specific day, say every first Monday of the month at 7:00 PM. Didn't see any action to achieve this. Is it possible? If yes, how?

Using Macrodroid on Android 10.

mj
One way would be to just add a "Day/Time" trigger.

Trigger:

Day/Time - monday 7pm

Actions:

set integer variable to - expression - [dayofmonth]
if integer variable < 8
run your actions
end if

this way it will just trigger every week and check if it's the first monday or not.
 

mmjoshi

Member
One way would be to just add a "Day/Time" trigger.

Trigger:

Day/Time - monday 7pm

Actions:

set integer variable to - expression - [dayofmonth]
if integer variable < 8
run your actions
end if

this way it will just trigger every week and check if it's the first monday or not.
Didn't see this before I replied to your earlier post. This should work. Thanks.
 

Dm114

Well-known member
Didn't see this before I replied to your earlier post. This should work. Thanks.
Another way, a bit simpler, would be to create a local integer variable, let's say 'LastMonth' to store the current month number and add constraint to your 'Date/Time' trigger. You would have something like that:
T: Date/Time every Monday
+--C: [lv=LastMonth] != [month_digit]

A: [v=LastMonth] = [month_digit]
A: your actions...

The constraint could be either individual (associated to the trigger) or global (applied to the whole macro). In your case it will be equivalent and maybe clearer at the global level. It's up to you!
 

Dm114

Well-known member
you can also use "Day/time" trigger (every monday at 7pm) with a "Day of the month" (day 1,2,3,4,5,6,7) constraint, this way you won't even need to use any variable.
I had never used nor even seen this constraint. 👍
 
Last edited:

420

Active member
Created this macro yesterday. Since it is past the first Monday of the month, seeded the variable LastMonth with a value of 8. Should work.

Thanks for the tip.
i'm not sure what you created, but the DayOfMonth constraint in that screenshot is NOT a variable, it is just a "Time/Date" - "Day of the month" constraint, if you properly recreated this you would not need any variable..
 

Dm114

Well-known member
Created this macro yesterday. Since it is past the first Monday of the month, seeded the variable LastMonth with a value of 8. Should work.

Thanks for the tip.
With the constraint 'Day of the month - 1 to 7' it's much easier. As @Pseudocyclic showed you, you even don't need any variable: the trigger will only fire at the selected day-time if the day of the month is within the selected range.
 

Kasu64

New member
you can also use "Day/time" trigger (every monday at 7pm) with a "Day of the month" (day 1,2,3,4,5,6,7) constraint, this way you won't even need to use any variable.
What a great idea @420 !
Thanks a lot !

And if we need to test the
2d sunday or other (monday,...),
The "Day of month" would be 8-14

Then 15-21 for the 3d sunday,

Then 22-28 for the 4d sunday,

Then 29-31 for the 5d sunday

Thats right ?
 

Dm114

Well-known member
What a great idea @420 !
Thanks a lot !

And if we need to test the
2d sunday or other (monday,...),
The "Day of month" would be 8-14

Then 15-21 for the 3d sunday,

Then 22-28 for the 4d sunday,

Then 29-31 for the 5d sunday

Thats right ?
You're right!
I've made a small Action Block for my personal usage. If you're interested I could send it here on the forum or put it in the Template Store.
 

Kasu64

New member
You're right!
I've made a small Action Block for my personal usage. If you're interested I could send it here on the forum or put it in the Template Store.
Thank you very much @Dm114.

My question was only a thought, without an immediate need.

I found this use very interesting and judicious, and I pushed the reflection a little further, hoping to be useful, in my capacity as a Beotian and an apprentice regarding macrodroid.

But your proposal will be useful to the community of macrodroid enthusiasts.

Thanks again
 

Dm114

Well-known member
Thank you very much @Dm114.

My question was only a thought, without an immediate need.

I found this use very interesting and judicious, and I pushed the reflection a little further, hoping to be useful, in my capacity as a Beotian and an apprentice regarding macrodroid.

But your proposal will be useful to the community of macrodroid enthusiasts.

Thanks again
Here is the link to the Template Store:

And the link to the post explaining how it works:
 
Top