Is something like this possible.. if([sms_number].length >= 5 AND [sms_number.length <= 6 AND != contacts){do this thing} ???

rmtbrowng

New member
Hello all,

Is it possible to set an if statement to prevent the action from triggering unless the senders sms number is between 5 and 6 digits in length ??

I have a macro made that currently copies numeric OTPs (one time passwords) and tries to find and copy alpha numeric OTPs to the clipboard as well as reading the code out loud. It does its job well enough for me inspite of the fact that my REGEX is somewhere between bad and atrocious, as well as the fact that I am super new to macrodroid.

The biggest problem I need to overcome is a few false positives sometimes pop up. For example, when one of my credit card providers notifies me of a charge etcetera. I can overcome pretty much all of these by not triggering the macro if it is not in my contacts and if senders phone number contains less digits than a standard U.S. phone number (7-11 digits).
 

rmtbrowng

New member
Another potential solution would be ...

If (sms_number.length >= 5 AND sms_number.length <=6 AND SMS_MESSAGE contains alpha numerics only (no $,.) {Do this thing}

but as I said, my regex is horrible, I wouldn't be able to write it and worse yet, Regex formatting seems to be different then the coding languages I am reasonably familiar with.
 
Top