Read EVERY whatsapp messages

Hi,

I'd like a macro that reads aloud every whatsapp message : let's say I get this kind of notification after several messages :
Whatsapp
- group 1
message 1
message 2
- group 2
message 1
- contact 1
message 1

You get the idea.

The problem is that I have great difficulties making MD read the contact name, or the group name, when several messages arrive. It just says "Whatsapp - 4 news messages" and doesn't read them.
I tried putting each message inside an array, and reading each line of the array, but it was definitely too difficult, sometimes it didn't work.

I have a S23, and with samsung routines i can read each message individually, with the associated group/contact name, but the Samsung routines are not powerful enough, and I want to be able to do it via MD (because I want to add constraints, which is not possible with Samsung routines).

Thanks !
 

Endercraft

Moderator (& bug finder :D)
Guess not. Although I do agree that being able to read "sub notifications" and creating them with MacroDroid would for sure be great.
 

hsurB

Well-known member
I'd just like to confirm that if someone sends few messages one after another. Like he writes one sentence, sends and write other sentence instantly after and sends it as well macrodroid might miss it. I have macro that saves messages from instagram into an array and it misses some of them but I can help with creating macro that will store texts from whatsapp in an array. I am just not sure how to make macrodroid know when he should read them - like stopwatches for exemple? When after receiving text there is no other incoming message for like 5s for exemple?
 
I don't mind missing, sometimes, a few messages. Usually when several messages are sent in a short period of time it's because there are several people discussing within a whatsapp group.
I had created a macro storing each message in an array, counting the lines, reading each line, reseting the variable etc... but I was not good enough to create a macro that was reliable, it would sometimes read endlessly the messages... Then I bought a Samsung and found that the built in routine was quite good, unfortunately it can't be associated with MD (unless there is a samsung plugin I don't know ?)
 

hsurB

Well-known member
You could use notifications to comunicate between macrodroid and samsung's modes and routines app since both can do something when notification is received and show custom notifications but I am not sure if that helps
 
You could use notifications to comunicate between macrodroid and samsung's modes and routines app since both can do something when notification is received and show custom notifications but I am not sure if that helps
Samsung routines only allows to read the notification aloud, it can"t display a notification containing the WA message...
 

MacroDroidDev

Administrator
Staff member
The issue is that MacroDroid can only 'see' what is in the notification and when you get multiple messages they get grouped up and appear like this.

One possible solution may be to clear each WhatsApp notification as it comes in. In this way each new message should appear as new notification and the contents should be readable.
 

gielie

New member
What admin said in the post before mine...
That was what I immediately thought of as well.

Perhaps you would need a few separate macros for this

No1 acts as a Daemon.. doing nothing untill a whapp notification triggers it.
It then starts a stopwatch. The starting of this stopwatch triggers macro No2.

Macro No1 stores the message in a global Array No1, and immediately dismisses the notification, waiting for the next notification.

After a set time of your choosing (say 5 minutes), macro No2 disables No1, stops and resets the Stopwatch and enables macro No3, which is a clone of macro No1, with the difference that No3 stores the messages in global Array No2.

Macro No2 then enables macro No4, which is a clone of No2 and runs macro No5. Then No2 should then disable itsself.

So now No3 and No4 (the clones) have completely taken over from No1and No2 in gathering new messages. No3 and No4 keep doing this for the same amount of time (5 minutes) after which No4 stops and disables No3, enables No 1, runs No5 and disables itsself (No4).
This will be an endless alternating loop.

No5's sole task is to read out aloud the messages stored in either of the 2 arrays.

No2 could set a value of 2 in an integer global variable, and No4 a value of 4, right before they respectively run No5, so No5 knows which of the 2 arrays to read out. When No5 is finished reading out aloud, it should empty the array it just read.

No5 should have enough time to read out all the messages, so don't make each alternating record cycle too short (the 5 minutes cycle) or you have add in more duos ( No5+No6 etc )

This should be a viable approach.
I may try and test this myself, in a bit.

See att for a simple setup example
 

Attachments

  • whappmacros.zip
    7 KB · Views: 4
Last edited:
Top