Write notification to file

Post your questions and help other users.

Moderator: Martin

Post Reply
Zaro
Posts: 3
Joined: 27 Jan 2015 00:31

Write notification to file

Post by Zaro » 27 Jan 2015 00:37

Hi guys,
i need help to create a flow that write every whatsapp notificiation in to a file.

For now i just obtained a file with "null" :(

Trigger with:
Notification on statusbar displayed > com.whatsapp

and after? i need to put in a var or i can write in a file directly?

i looked everywhere but i can't find any help..

tnk for attention :mrgreen:

zaro

User avatar
TheBrain1984
Posts: 137
Joined: 07 Aug 2013 08:17
Location: Germany

Re: Write notification to file

Post by TheBrain1984 » 27 Jan 2015 08:49

First of all, sorry but you are in the wrong topic. You are in the "flow sharing area", this topic is for finished flows to share.

For you're problem. The trigger you described gives you some variables, you can find a detailed description of every action, condition and trigger if you click the "?" in the action, condition and trigger. This trigger gives you for example the var title. This var contains the the title of the notification for WhatsApp notifications it's usually the name. It also have notification_text or notification_text_big, this contains usually the message.
The problem is, if the message from WhatsApp get's to long, you won't get the whole message, because the notification doesn't have the whole message, another problem, if two or three people write you and you didn't checked your messages for a while (or without deleting them by Automagic), WhatsApp uses something like "4 messages in 3 chats" and that is what you'll get in your file, maybe the "notification_text_big"-var will have the real messages longer but I'm not sure.

Zaro
Posts: 3
Joined: 27 Jan 2015 00:31

Re: Write notification to file

Post by Zaro » 27 Jan 2015 12:59

sry for wrong section and tnk for ur reply man.

ok, we suppose that i take notification_text and put it in a var called "A". My first problem is to write in file

then Trigger= notification in statusbar from whatsapp

Action= A=a+notification_text (can i do it?)

Action= write "A" to file (how to write var in text?)

the results will be so dirty but isn't a problem

User avatar
TheBrain1984
Posts: 137
Joined: 07 Aug 2013 08:17
Location: Germany

Re: Write notification to file

Post by TheBrain1984 » 27 Jan 2015 14:05

Almost.

First we need to know that "A" in that case would be local var, that means that it will be empty at the beginning every time the flow runs (simply said), that means "A = A + notification_text" will always be same as "A = notification_text"

So what you need is something like this

Code: Select all

Trigger: notification in statusbar

com.whatsapp
like you already have correctly. This trigger gives you the variables described by the "?" (title, title_big, notification_text, notification_text_big, and so on)

Code: Select all

Action: Script

A = notification_text
And another action like this one:

Code: Select all

Action: write to file (or something like that, I have the german version)

filename: the filename (including the path) you want to write to

text: {A}

checkbox for appending have to be checked
the "{" and "}" you need to declare that text is kind of sourcecode in that case just the var "A".

Zaro
Posts: 3
Joined: 27 Jan 2015 00:31

Re: Write notification to file

Post by Zaro » 28 Jan 2015 10:47

tnk u man!!! we done :mrgreen:

Post Reply