Hi,
I am trying to create a whitelist file containing email address. I am trying to put condition to check if the email exist. Somehow it is not working. I suspect that this is because of the special character "@". With normal characters (letters and numbers) it is working. I used the following
indexOf("/storage/emulated/0/email_whitelist.txt",{k9_from})<=0
also will this work as well?
matches)("/storage/emulated/0/email_whitelist.txt",{k9_from})
Thanks
search email address in a lookup file
Moderator: Martin
Re: search email address in a lookup file
First, you have to use action Init Variable Text file, from the /storage/emulated/0/email_whitelist.txt, save it to a variable {file_text}.
Then you can use indexOf() to search the email
indexOf(file_text, {k9_from})<=0
Matches() will use regex, need to add the regex syntax, which is not needed in this case.
For saving the supporting files, i would prefer keep it in the same folder with automagic. Beside not cluttering the root folder of the /sdcard/, it also make it easier to backup or move it all to another phone. I keep mine at /sdcard/Automagic/Resources/. Have been doing the same since using tasker before.
Then you can use indexOf() to search the email
indexOf(file_text, {k9_from})<=0
Matches() will use regex, need to add the regex syntax, which is not needed in this case.
For saving the supporting files, i would prefer keep it in the same folder with automagic. Beside not cluttering the root folder of the /sdcard/, it also make it easier to backup or move it all to another phone. I keep mine at /sdcard/Automagic/Resources/. Have been doing the same since using tasker before.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Re: search email address in a lookup file
Thanks dude