1. Download our Official Android App: Forums for Android!

[Q] Tasker: SMS to Array?

Discussion in 'Android Apps & Games' started by Flandria4, Aug 6, 2013.

  1. Flandria4

    Flandria4 Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    2
    Joined:
    Aug 6, 2013

    Aug 6, 2013
    2
    0
    5
    Hey there!

    I've bought Tasker today and I'm messing around with it...

    I'm trying to store 4 incoming text messages in an array with Tasker. I receive these texts upon sending a trigger word to my carrier and I'd like to extract information from these messages to display how many minutes, data and texts I have left to send.

    My set-up is exactly as the tutorial I've followed: joskeq.blogspot.be/2012/10/
    This tutorial needs some tweaking, however. I've found some more information regarding the topic: grokbase.com/t/gg/tasker/12a1...s-content-slow


    What should happen, every time I run my profile:

    1. Trigger word is send
    2. Array puts 4 incoming messages in variable %StoredBodies
    3. Once %StoredBodies(#) = 4, it checks every single array (1-4) on different keywords and then splits the variable.

    What actually happens is that only the last message is stored in %StoredBodies. If I re-run the task without sending the triggerword I see %StoredBodies1 ... 2 ... 3 popping up with the content of the last message.

    Why didn't Tasker store the other messages it received first? I've thought of deleting the last message after it was stored but there is no official procedure for that.

    Anyone able to help me?

    Thanks in advance!
     

    Advertisement

  2. KitWasHere

    KitWasHere Well-Known Member
    Rank:
    None
    Points:
    53
    Posts:
    109
    Joined:
    Mar 31, 2013

    Mar 31, 2013
    109
    39
    53
    Will be easier to troubleshoot if you post what you have already.

    Tasked only holds the most recent SMS info, so you will have to add to your array as they come in with "array push"
     
  3. Flandria4

    Flandria4 Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    2
    Joined:
    Aug 6, 2013

    Aug 6, 2013
    2
    0
    5
    What I have is what I followed in the tutorial: (XML below)

    [​IMG]


    Project: Download
     
  4. KitWasHere

    KitWasHere Well-Known Member
    Rank:
    None
    Points:
    53
    Posts:
    109
    Joined:
    Mar 31, 2013

    Mar 31, 2013
    109
    39
    53
    It seems like Tasker cannot catch up to how fast the text's are coming in. If you have root, you could add a couple second wait on an "SMS Received" event, and then run this script to give you the 4 most recent text's:

    sqlite3 data/data/com.android.providers.telephony/databases/mmssms.db "SELECT body || '@|@' FROM sms ORDER BY _id DESC LIMIT 4;"
     

Share This Page

Loading...