Read via scripting modified WhatsApp message aloud
Posted: 19 Apr 2015 18:22
Hi folx,
meanwhile i'm a little desperated
My little project should read an incoming WhatsApp message via car's BT
Is it a single message reading works without a problem.
If there are more than 1 unread message the used {notification_text_big} cause the TTS Modul to read all unread messages - including pictures and videos.
So i tried to split the {notification_text_big} with the following Scrtipaction:
But the resulting list called wa appears as follows:
Someone has an idea where is the bug in my thinking ? Maybe someone has a solution ?
If i can delete the "empty spaces" ( which seem to be NOT EMPTY ) i would reverse the list then delete the field with 2 Nachrichten and also the field containing ... and read aloud the resulting first field which is the latest incoming message.
THX in advance
Rhonin
meanwhile i'm a little desperated

My little project should read an incoming WhatsApp message via car's BT
Is it a single message reading works without a problem.
If there are more than 1 unread message the used {notification_text_big} cause the TTS Modul to read all unread messages - including pictures and videos.
So i tried to split the {notification_text_big} with the following Scrtipaction:
Code: Select all
Test = ({notification_text_big });
zeilen = split(Test, "\\n");
wa = newList();
for (Zeile in zeilen)
{
result = matches(Zeile, "\\w+");
if (result = true)
{
wa = addElement(wa, Zeile);
}
i tried different pattern matches to prevent such "empty" fields like in between WhatsApp and CM12 and at the end between test2 and .... but all my efforts were not successful wheter whitespaces \\s nor " " or testing if there are "words" "\\w+"[WhatsApp, , CM12: Test1, Adc rhonin: Test 2, , , , , , …, 2 Nachrichten in 2 Chats.]
Someone has an idea where is the bug in my thinking ? Maybe someone has a solution ?
If i can delete the "empty spaces" ( which seem to be NOT EMPTY ) i would reverse the list then delete the field with 2 Nachrichten and also the field containing ... and read aloud the resulting first field which is the latest incoming message.
THX in advance
Rhonin