Page 1 of 1

Read modified WhatsApp message aloud

Posted: 25 Apr 2015 05:31
by Rhonin
Hi folx,

i decided to share my little flow with you and hope that you enjoy it and maybe one or another find some extensions for it :D

What it is all about ?

Well - my first flows are created to automate listening to audible while driving to work. One flow is triggered by leaving my homenetwork and the other by disconnecting from my car's bluetooth. In both flows it is checked if there is a calendar entry named "*schicht" - this means i'm working in a shift-system and i have no normal office times.
  • When i drive to work i also want to know what kind of WhatsApp messages come in without looking on my phone - so the idea of this little flow was born. The flow is triggered by the notification in the statusbar.
  • Then the first action says "Achtung" - which means -> Pay attention ! . It is not necessary and can be deleted. But i noticed that my car's bluetooth is a kind of slow and the first sentences were not read - so i decided to get some additional time for the car's bt's reaction.
  • The second action just tells me who sended the message to me. in German: "Nachricht von Martin" for example - "Message from Martin"
  • The third "Scriptaction" is the heart of this flow. It takes the {notification_tex_big} and manipulate it till the resulting "TEXT" - variable only contains the last message.
  • With the fourth action the variable "TEXT" is read aloud
  • The last action simply deletes all WhatsApp-messages in the statusbar.
It is also important to set the flows option to "wait until the actual instance has been ended" - otherwise you get funny readings :mrgreen: if you receive a lot of messages nearly simultaneous.
flow_WhatsApp_20150425_070515.xml
(5.07 KiB) Downloaded 2456 times
Maybe this flow is of use for someone and for additional tips i will be grateful. A more detailed description of the script can be found under -> http://automagic4android.com/forum/view ... f=5&t=3909

Cheers

Rhonin

Re: Read modified WhatsApp message aloud

Posted: 01 Jun 2016 05:38
by Fr@ggel
Moin moin,
Als erstes ein großes Dankeschön für den super Flow.
Nutze ihn schon ne gaaaanze Weile.

Nur geht leider das Vorlesen nicht mehr.
Der ließt nur noch "Antworten" vor.
Kannst evtl. ein Update machen ?

Re: Read modified WhatsApp message aloud

Posted: 07 Jun 2016 19:50
by ariloc
It doesn't work at all. Between message, is heard 3 times approximately: "null".

Re: Read modified WhatsApp message aloud

Posted: 18 Jul 2016 13:09
by jeminar
I found a way to make WhatsApp messages readable without duplication or nulls; and without having to cancel the notifications.

use the notification_on_status_bar trigger

manipulate notification_text instead. It gives more false positives, but these are easily handled.

Code: Select all

a=split(replaceAll({notification_text}//,'\\n+',"/"),'/');
So far, the same as you in principle.
We then filter out the "many messages", which is a problem with notification_text. One feature to note is that the first part ends "new messages" if the message is stating that there are repeats; or the apparent sender is "WhatsApp" in some cases.

Code: Select all

if (getElement(a,0) != 'WhatsApp' AND right(getElement(a,1),12) != 'new messages') {speak = "WhatsApp from {getElement(a,0)}. {getElement(a,1)}";}
But this will repeat messages already received, so I manually catch duplicates (which are stored in a global list called global_spokenmessages)

Code: Select all

if (global_spokenmessages==NULL) {addElement(global_spokenmessages,'');}  \\initialise if not already
if (length(global_spokenmessages)>25) {removeElement(global_spokenmessages,0);}  \\only maintain most recent 25 messages
if (containsElement(global_spokenmessages,speak)) {speak='';}	 else {addElement(global_spokenmessages,speak);}	
This gives a variable speak which can be used in the speech output action, and will be an empty string if the message is a duplicate.

Re: Read modified WhatsApp message aloud

Posted: 14 Feb 2017 07:37
by Fr@ggel
Hello
Can you post the complete modified flow ?

Re: Read modified WhatsApp message aloud

Posted: 25 Apr 2017 23:02
by sitruk
I'm also interested in a completed flow. I am trying to do this with hangouts if at all possible.