Count number of whatsapp launches in a day

adorablesoup

New member
I'm trying to count how many times I open whatsapp in a 24 hour period, and each time I open a notification should arise with the count.

I've created an integer variable to do this, which resets everyday at 00:00.

The problem however is that when I have the app open, if I load up the keyboard to type something, and then minimize the keyboard, it counts it as though I have opened the app.

Is there any way around this?

I've thought about using 'invoked/not invoked recently' constraint, but is there any other way around this? As I might be typing a long message in whatsapp, and then minimize my keyboard, only for it to trigger the macrodroid script. In other words this isnt a good solution for me.

Thanks in advance for your help
 

Jacob L

Moderator (Lawsonator)
Maybe create a variable which stores a history of one package, using the history package to check if it is the keyboard, if not then count.
 

OscariBot

Active member
I'm trying to count how many times I open whatsapp in a 24 hour period, and each time I open a notification should arise with the count.

I've created an integer variable to do this, which resets everyday at 00:00.

The problem however is that when I have the app open, if I load up the keyboard to type something, and then minimize the keyboard, it counts it as though I have opened the app.

Is there any way around this?

I've thought about using 'invoked/not invoked recently' constraint, but is there any other way around this? As I might be typing a long message in whatsapp, and then minimize my keyboard, only for it to trigger the macrodroid script. In other words this isnt a good solution for me.

Thanks in advance for your help
You can add whatsapp not on foreground constrain. see my screenshot below. though am using whatsapp business but it works for me.
 

Attachments

  • Screenshot_20221103-184604.png
    Screenshot_20221103-184604.png
    52.9 KB · Views: 11

Endercraft

Moderator (& bug finder :D)
You can add whatsapp not on foreground constrain. see my screenshot below. though am using whatsapp business but it works for me.
Weird that it works, the point of an app launched trigger is to detect when an app is foreground but with the not foreground constraint, you're basically making an opposite that will never trigger.
Like using a Wi-Fi ON trigger but the constraint is Wi-Fi OFF.
 

OscariBot

Active member
Weird that it works, the point of an app launched trigger is to detect when an app is foreground but with the not foreground constraint, you're basically making an opposite that will never trigger.
Like using a Wi-Fi ON trigger but the constraint is Wi-Fi

This work flawlessly @Endercraft notice my constrain says (when whatsapp is not on foreground). so interpreting this macro will be (when whatsapp is opened and ofcouse it wasn't on foreground at first so the constrain won't affect it) hence it will trigger the macro.

The idea of introducing this constrain is to stop what @adorablesoup complain earlier that when he minimize the keyboard and reload it while still on whatsapp the macro fired. So with this constrain I was able to overcome that. maybe @adorablesoup will check this out and tell us if it actually solve it problem.
 

Endercraft

Moderator (& bug finder :D)
This work flawlessly @Endercraft notice my constrain says (when whatsapp is not on foreground). so interpreting this macro will be (when whatsapp is opened and ofcouse it wasn't on foreground at first so the constrain won't affect it) hence it will trigger the macro.

The idea of introducing this constrain is to stop what @adorablesoup complain earlier that when he minimize the keyboard and reload it while still on whatsapp the macro fired. So with this constrain I was able to overcome that. maybe @adorablesoup will check this out and tell us if it actually solve it problem.
I tried this but it never worked with the constraint.
 

adorablesoup

New member
Maybe create a variable which stores a history of one package, using the history package to check if it is the keyboard, if not then count.
Could you send me a screenshot of how this would work, I dont quite understand.

You can add whatsapp not on foreground constrain. see my screenshot below. though am using whatsapp business but it works for me.
That doesnt work for me
 

MacroDroidDev

Administrator
Staff member
Please do the following.

Create a temporary macro as follows:

T -Regular Interval trigger 1 second
A - Log event (hit ... and select foreground package name)

Then open whatsapp and open the keyboard for a while.

Disable this temporary macro and identify what package the keyboard appears as.

You can then use this value to prevent the increment when this is the foreground app package.
 
Top