Probably rookie help

Post your questions and help other users.

Moderator: Martin

Post Reply
pnop
Posts: 7
Joined: 07 Aug 2013 12:27

Probably rookie help

Post by pnop » 07 Aug 2013 12:30

Hi, I’m a user of Tasker and AutomateIt, not until recently I found out about AutoMagic (AM). Love the concept and I’m trying to migrate all my rules to AM. I’M spending a hard time trying to build a flow that reads an app notification, identifies its title and then performs an action according to a condition.
My problem is with the condition itself; the trigger is ok (notification of an app), but how can AM read the notification title? Much probably a basic question, but I need your help or even a simple flow template, please. TY so much!

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Probably rookie help

Post by Martin » 07 Aug 2013 16:50

Hi,

The trigger Notification on Statusbar Displayed supplies the title in the variable title to the flow.
The variables which a trigger provides to the flow are listed on the documentation page of the trigger (press the question mark button in the editing screen of the trigger and scroll down to the variables section).

There is a short tutorial on the Automagic website that shows how a variable can be displayed:
http://automagic4android.com/en/help/cr ... first-flow

You can add a condition Expression to check the contents of the variable and execute different actions on the true or false branch of the condition.
For example to check if the variable exactly contains the text "test":
-condition Expression: title=="test"

...or if the title starts with "test":
-condition Expression: startsWith(title, "test")

...or if the title contains the word "test":
-condition Expression: indexOf(title, "test")!=-1

...or for regular expressions:
-condition Expression: matches(title, "test.*")

Automagic also contains a condition called Debug Dialog that can be added to a flow to show a dialog with all available variables.

Regards,
Martin

pnop
Posts: 7
Joined: 07 Aug 2013 12:27

Re: Probably rookie help

Post by pnop » 07 Aug 2013 17:45

Ok, got it! Rookie, really... My problem was not setting a variable correctly (was showing "not available") and also spaces between title and == in the expression.
Thanks for the quick reply, great great help!
As a side note, let me tell you that a long time ago, intial period in university, I loved computer programming. Your app reminds of those memorable methods, AM is the best.

Post Reply