AutoNotification Regex, Autonotification and sports scores - I'd like to change the output of the notification

Discussion in 'AutoApps' started by BrianZ, Dec 1, 2019.

  1. BrianZ

    BrianZ New Member

    Joined:
    Dec 1, 2019
    Messages:
    2
    Likes Received:
    1
    New to Tasker and no programming skills. I found an xml profile that will cast my phone's notifications to my Google Home. (text to speech) Pretty cool.

    I'd like it to speak in a more coherent manner. For example, most sports apps will abbreviate; instead of touchdown the notification states"TD" or instead of interception the notification states 'INT". So the Google Home says exactly what's printed - you can imagine how funny that sounds lol.

    Is there a way using regex to replace TD and output touchdown, etc instead? I've done a lot of research and can't figure this out. Any examples would be appreciated.
     
  2. virtual

    virtual New Member

    Joined:
    Jul 8, 2018
    Messages:
    19
    Likes Received:
    0
    Why don't you use Tasker to process the captured text from the notification? Something like this:

    ReplaceTest (96)
    A1: Variable Set [ Name:%text To:This a sample TD, not an INT! But this doesn't catch INTERSTATE for example... Recurse Variables:Off Do Maths:Off Append:Off Max Rounding Digits:3 ]
    A2: Variable Search Replace [ Variable:%text Search:\bTD\b Ignore Case:Off Multi-Line:Off One Match Only:Off Store Matches In Array: Replace Matches:On Replace With:touch down ]
    A3: Variable Search Replace [ Variable:%text Search:\bINT\b Ignore Case:Off Multi-Line:Off One Match Only:Off Store Matches In Array: Replace Matches:On Replace With:interception ]
    A4: Flash [ Text:%text Long:On ]


    Then you can replace the first action by getting the text from %antext (depending on your notification).

    Can you post the link to that profile? I need to to this too (and maybe check if it's available for Alexa, too).
     
  3. BrianZ

    BrianZ New Member

    Joined:
    Dec 1, 2019
    Messages:
    2
    Likes Received:
    1
    virtual likes this.
: regex

Share This Page