#! /system/bin/shyourmail="MYN...@gmail.com"dir="/data/data/com.google.android.gm/databases/"case "$1" inname)sqlite3 ${dir}mailstore.${yourmail}.db "select fromAddress from messages ORDER BY _id DESC LIMIT 1" | grep -o '"[^"]*"' | tr -d \";;email)sqlite3 ${dir}mailstore.${yourmail}.db "select fromAddress from messages ORDER BY _id DESC LIMIT 1" | grep -o \<.*\> | tr -d '<>';;subject)sqlite3 ${dir}mailstore.${yourmail}.db "select subject from messages ORDER BY _id DESC LIMIT 1";;*)sqlite3 ${dir}mailstore.${yourmail}.db "select * from messages ORDER BY _id DESC LIMIT 1" | awk '/@/{FS="|";print $4,$11}';;esac
1. Run Shell - command - !@ sh /sdcard/mailsender subject > /sdcard/mailsubject ///This successfully makes a new file once triggered, but the file is blank.2. Wait - 2 seconds3. Run Shell - command - Read Line mailsubject Line 1 to var %MAILSUB ///This doesn't seem to do anything (probably because the file is blank
Timeout (0)
Use Root (yes)
Store Output in (%MAILSUB)
Matt
Matt
Ahh, yeah I was running 3 separate scripts. Your way is great though, I just replaced the _id with snippet to put into my popup, thanks mate!
--
You received this message because you are subscribed to a topic in the Google Groups "Tasker" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tasker/_Py7jQxIYKM/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to tasker+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Jonathan is it possible to put your profile, task, and scene here?
Sure. Attached is the scene and task xml.You just need to edit the task xml and replace YOURMAIL with the account name in 2 places (see command below).
Task steps:1. Variable Clear > Name: %MAILINFO
2. Secure Settings> Run Command: 'sqlite3 /data/data/com.google.android.gm/databases/mailstore.YOUR...@gmail.com.db 'select fromAddress,subject,snippet FROM messages WHERE fromAddress NOT LIKE "YOUR...@gmail.com" ORDER BY _id DESC LIMIT 1' | sed s/\"//g | sed s/.com//g | sed s/re://g | sed s/fw://g | sed s/fwd://g'
Use Root & Wait for Proces.Command Name: GMGETOutput variable: %MAILINFO3. Wait > 2 Seconds > Until %MAILINFO Is Set4. Variable Split > %MAILINFO > Splitter |5. Popup > Text: You've got mail! > Layout: Email Not > Timeout: Pick whatever you want, I have never.
Enjoy.
Matt
I have created a task in tasker.
It contains a secure service plugin that has the following command.
cd /data/data/com.google.android.gm/databases; sqlite3 mailstore...@gmail.com.db select fromAddress from messages limit 1;
I am now at least getting it to output the error to a vairiable. The error is
Sqlite3: error: Too many options: "fromAddress"
I thought limit 1 would only get the first record
...@gmail.com.db "select ... limit 1"; ...
Matt
So I've been looking for a way to put specific Gmail information in my notification popup. Right now I just have %NTITLE in my popup.I've been reading up here about setting up a script to get gmail information and put it in a variable, but I can't quite get it working. I think some of the options are outdated and not available in the latest Tasker, and since I'm a n00b I don't know if I'm using the right substituteThe linked thread talks about 'Locale Execute Plugin' but I can't find that anywhere on my tasker, so I've been using Run Shell instead.Anyway, after reading that thread, I put together the profile that is triggered by a notification owned by Gmail.I have a file 'mailsender' saved on my sdcard with the following script:#! /system/bin/shyourmail="MYN...@gmail.com"dir="/data/data/com.google.android.gm/databases/"case "$1" inname)sqlite3 ${dir}mailstore.${yourmail}.db "select fromAddress from messages ORDER BY _id DESC LIMIT 1" | grep -o '"[^"]*"' | tr -d \";;email)sqlite3 ${dir}mailstore.${yourmail}.db "select fromAddress from messages ORDER BY _id DESC LIMIT 1" | grep -o \<.*\> | tr -d '<>';;subject)sqlite3 ${dir}mailstore.${yourmail}.db "select subject from messages ORDER BY _id DESC LIMIT 1";;*)sqlite3 ${dir}mailstore.${yourmail}.db "select * from messages ORDER BY _id DESC LIMIT 1" | awk '/@/{FS="|";print $4,$11}';;esacThe task to get the subject is:1. Run Shell - command - !@ sh /sdcard/mailsender subject > /sdcard/mailsubject ///This successfully makes a new file once triggered, but the file is blank.2. Wait - 2 seconds3. Run Shell - command - Read Line mailsubject Line 1 to var %MAILSUB ///This doesn't seem to do anything (probably because the file is blankI was hoping at the end of this I would have a populated %MAILSUB variable that I could throw into a scene field to show the Subject line of the latest email, but something's going wrong on the way.I have zero experience with Run Shell or any of these scripts, so hopefully there's something simple I'm missing or a different way of going around this. I'm on a rooted GS2 if that helps.Cheers,Jona