• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

[Q] Tasker: SMS to Array?

Flandria4

Lurker
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!
 
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"
 
What I have is what I followed in the tutorial: (XML below)

AnalyseSms.jpg



Project: Download
 
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;"
 
Back
Top Bottom