Read modified WhatsApp message aloud

Share and discuss your flows and ideas with other users.

Moderator: Martin

Post Reply
User avatar
Rhonin
Posts: 19
Joined: 08 Apr 2015 05:23

Read modified WhatsApp message aloud

Post by Rhonin » 25 Apr 2015 05:31

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
Automagic on rooted Xperia Z3c running on Android 5.1.1

Fr@ggel
Posts: 5
Joined: 31 May 2016 08:23

Re: Read modified WhatsApp message aloud

Post by Fr@ggel » 01 Jun 2016 05:38

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 ?

ariloc
Posts: 109
Joined: 05 Jun 2016 21:36

Re: Read modified WhatsApp message aloud

Post by ariloc » 07 Jun 2016 19:50

It doesn't work at all. Between message, is heard 3 times approximately: "null".

jeminar
Posts: 4
Joined: 11 Jun 2016 10:52

Re: Read modified WhatsApp message aloud

Post by jeminar » 18 Jul 2016 13:09

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.

Fr@ggel
Posts: 5
Joined: 31 May 2016 08:23

Re: Read modified WhatsApp message aloud

Post by Fr@ggel » 14 Feb 2017 07:37

Hello
Can you post the complete modified flow ?

User avatar
sitruk
Posts: 50
Joined: 14 Jul 2015 14:44

Re: Read modified WhatsApp message aloud

Post by sitruk » 25 Apr 2017 23:02

I'm also interested in a completed flow. I am trying to do this with hangouts if at all possible.

Post Reply