My flow ultimately takes a WhatsApp notification and posts the body text of it to Facebook. Overall the flow is working at the beginning (grabbing the WhatsApp notification) and end (posting to Facebook) but I'm having trouble parsing the notification with Script. Here's the entirety of my Script action:
Code: Select all
whatFace = split(notification_text_big, "\\n"); //Split entire notification into separate lines
thirdLine = getElement(whatFace, 2); //Specify the third line, which is where the message body text begins
whatFaceVariations = newList("WhatFace", "Whatface", "whatFace", "whatface", "What Face", "What face", "what Face", "what face"); //Create a list of various ways to type "WhatFace" to check through
/*
Checks the message text for variations of "WhatFace"
Removes any instances of variations of "WhatFace"
Combines the lines in the message in one variable, excluding the sender (first line) and line break (second line)
Returns true if variations of "WhatFace" were found
*/
for (variation in whatFaceVariations)
{
if (contains(thirdLine, variation))
{
thirdLine = replaceAll(thirdLine, variation, "");
getElement(whatFace, 0) = replaceAll(getElement(whatFace, 0), "");
getElement(whatFace, 1) = replaceAll(getElement(whatFace, 1), "");
whatFaceTriggered = true;
}
}
Sony Xperia TX (LT29i)
Android 4.3
Automagic Premium 1.26.0 (Build 20141219_133159_4ba158f)
P.S. - Thank you Martin (and team?) for your efforts in developing such an amazing app/system! Your patience and dedication to helping users and making Automagic better is commendable
