Matt
Anyway, what I think you want is: If %SMSRB ~ X(your defined text, remember to have "*" at the beginning and end of your text, send %SMSRB to X phone number. Don't use = because it means that the variable must equal a number and not a predefined text
Matt
Matt
What I don't get is if your suggested A2 is the "if" section that I see when creating A1, at the bottom of the screen. Because if so, when I store it and return to the TaskEdit screen, I see 1. Variable Set %Tmp, %SMSRB if %Tmp ~ @ followed by a red mark (I assume this means "Houston we have a problem). If I remove the if mark, there is no color marker, not even a green one.
If the A2 "if" is a total seperate task, where in the menu can I find it then? <=== Found in Task > If
While I was at it, I am looking into a way to send a message to the sender as a confirmation in case the task was successfully processed. And a message "Houston we have a problem, check your message for errors" in case A2 or A4 went wrong. Hey, why not conditional ? If A2 went sour: "Sorry, please check your email address." If A4 went wrong "Sorry, unknown code". Should that be placed right under A2? Like :A1: Variable Set [ Name:%Tmp To:%SMSRB Do Maths:Off Append:Off ]A2: If [ %Tmp ~ *@*.* ]A2.2: ! If [ %Tmp ~ *@*.* ] <== exlamation mark : if no email address is found, then do A2.3 which could be something like send message to %sendernumber with body "Sorry check email address".A2.3: send SMSA3: Variable Section [ Name:%Tmp From:1 Length:5 Adapt To Fit:Off Store Result In: ]A4: If [ %Tmp ~ test ]A4.1 ! if [ %Tmp ~ test ] <== if code not recognized, send A4.2 sms to sender "sorry code unknown"A4.2 send SMSA5: <forward msg> <=== Only if both If statements are true will this be executed.
Sending these 2 additional messages is not really a must, but would be nice to have a system that is able to do it. The challenge will be how to organize it when managing multiple codes or key words, but I guess I can use A4
- Magic/Yellow/testxx/ as long as I use equal long words that will fit my Tmp Length xx.
But first things first. "test " with space after the last letter. That is the issue. Could the hex code for "space" do the trick? I guess Tasker looks at the letter, rather then interpreting a hex code.
Regards, and enjoy your weekend :o)Polar
Good point about the %Tmp ~ *@*Does your new A2 do exactly what you want it to do?Did you test it?
My goal is help YOU do this. I want to help you learn some of my troubleshooting methods.
This works, so instead of checking for "Test", we can check for "Test *". The addition of the space and * forces a check for a space character :>)
Oh NO! It begins - wandering requirements - the bane of all developers ;>)While I was at it, I am looking into a way to send a message to the sender as a confirmation in case the task was successfully processed. And a message "Houston we have a problem, check your message for errors" in case A2 or A4 went wrong. Hey, why not conditional ? If A2 went sour: "Sorry, please check your email address." If A4 went wrong "Sorry, unknown code".
A1: Variable Set [ Name:%TmpBody To:%SMSRB Do Maths:Off Append:Off ]
A3: If [ %TmpBody ~ *@*.* ]
A5: Send SMS [ number: %TmpFrom Message: "Sorry check email address".]A6: End ifA7: Variable Section [ Name:%TmpBody From:1 Length:6 Adapt To Fit:Off Store Result In: ]A8: If [ %TmpBody ~ test * ]A9: Send SMS [ number: %555 55 555 Message: "%SMSRB".]A10: ElseA11: Send SMS [ number: %TmpFrom Message: "Sorry unknown code".]
The challenge will be how to organize it when managing multiple codes or key words, but I guess I can use A4
- Magic/Yellow/testxx/ as long as I use equal long words that will fit my Tmp Length xx.
Matt
If I have an incoming message like thisSMSRF = 555 55 555SMSRB = some_code some_...@address.comI would like to create an action that does this:
Send SMS, Number = TmpFrom, Message = some_text_URL/?some_email@address.com
But, I did catch one part.
Since I don't know how long the email address is going to be in the received SMS, what is best practice to look at ALL text?
That is easily done by tasker using regex.
I think this would be:
^[A-z0-9._%+-]+@(?:[A-z0-9-]+\.)+[A-z]{2,4}$
Test that out. Let me know if it errors and on what. I will try and re-evaluate.
But this is not working well... The new message that I received on SMS send looks like this: "some_text_URL/?%arr0"
Any suggestions pls?
You never created an array.
Your task should be (basically):
If %SMSRB ~R ^[A-z0-9._%+-]+@(?:[A-z0-9-]+\.)+[A-z]{2,4}$
Set %regex to ^[A-z0-9._%+-]+@(?:[A-z0-9-]+\.)+[A-z]{2,4}$
Set %smsrb to %SMSRB
Split %smsrb splitter:optional
Set %forward to %smsrb(?#%regex)
Send SMS, content: %smsrb(%forward)
I used a regex checker and EVERY variation of email address I could think of proved to be a match. Anything that wouldn't resemble an email address does not.
However, I don't believe I considered the possibility of an underscore. That might be the issue.
Let me look into that when I can and get back to you.
The IF statement should be:
[\#]....... [A-z0-9._%+-]+@(?:[A-z0-9-]+\.)+[A-z]{2,4}$
Thus will match #(any seven characters) email address
But the variable set %regex should still be the same.
I'm still learning regex so as I know more I can be more help to you.
Is there a SPECIFIC format conformity for CODE after #?
Represents ANY character, including whitespace.
It should!
Oh, and I checked and I did account for an underscore in the email :-)
I'm interested in trying to add the use of a database. After doing some reading I am still a tad confused about how to implement this.
If I understand it correctly SQLite is default installed on Android. So the first question would be: do I need to install something like a Sqlite editor/manager?
I found an app that does just about what I am looking for, but is missing a few ingredients. Among other things are some subscribe commands in English, and can not be translated. This makes it less interesting to use for me. Also the option to store other information beside email,name and phone numbers is missing. I contacted the programmer, but he was not interested in adding these changes.
So I hope Tasker can come to the rescue :). Not sure.it would be more appropriate to start a new topic, so I'll start here first.
Can this be done with Tasker? Do I need additional software/apps?
Thank you for reading this:).