Page 1 of 1

open automagic = action

Posted: 10 Feb 2015 20:57
by evebrea
I am trying to lock automagic to where if it's opened it asks for a code input, but i can only manage when a window is opened or some such, and it's not very.. stable.

I'm looking for a way to trigger the action ONLY when the main app is opened, not dialogs or anything the program does (to lock someone from altering my flows)

Re: open automagic = action

Posted: 11 Feb 2015 03:37
by MURTUMA
I have a flow which relies on the same thing what you explained. This is how I found the activities required for it to work. There might be easier method I don't know of, but this works too:

1. Create a flow with trigger Activitity started: package name: Automagic, class: * . Put a condition Debug dialog after it and nothing else.
2. Create a flow, which has the activities you want to NOT to trigger the flow.
3. Run the second flow and the first flow should open the debug dialog. See the activity_class variable and copy it somewhere.
4. Repeat previous step but change the dialog action on second flow, until you have copied all the required class names.

Then to your actual flow, you need them in:

1. Trigger: App task started: Automagic
2. Condition: Expression: "top_activity == ch.grindvision.ppam.automagic.class name
>False > The rest of the flow.

You can do this check with one Expression condition as follows:
"top_activity == class name 1 AND top_activity == class name 2 AND top_activity == class name 3" and follow false path.


Here's some class names I captured. It might not be enough for you, but with above steps, you'll find the rest.
ch.grindvision.ppam.automagic.InputDialogActivity
ch.grindvision.ppam.automagic.AskUserActivity
ch.grindvision.ppam.automagic.MessageDialogActivity

Re: open automagic = action

Posted: 12 Feb 2015 10:11
by Nerey
MURTUMA wrote:"top_activity == class name 1 AND top_activity == class name 2 AND top_activity == class name 3"
You should use OR
Or compare with != and use True branch
And I think, maybe capture activity of main window is an easier way?

Re: open automagic = action

Posted: 12 Feb 2015 22:16
by MURTUMA
I didn't think of "!=" operator. That would be logically more sound.

When doing as I explained, the outcome is the same whether it's done with AND or OR logic. Which one is better is just semantics.

Re: open automagic = action

Posted: 13 Feb 2015 05:32
by Nerey
I mean that

Code: Select all

top_activity == "class name 1" AND top_activity == "class name 2" AND top_activity == "class name 3"
wouldn't work
It must be

Code: Select all

top_activity == "class name 1" OR top_activity == "class name 2" OR top_activity == "class name 3"
(false branch) or

Code: Select all

top_activity != "class name 1" AND top_activity != "class name 2" AND top_activity != "class name 3"
(true branch)
Because you can't be sure that top_activity is equal to two or more different activities at the same time

Re: open automagic = action

Posted: 14 Feb 2015 15:04
by MURTUMA
Yeah, it seems like you're right. My bad... :/

Re: open automagic = action

Posted: 18 Feb 2015 05:38
by evebrea
this seems complicated. I just wanted "automagic opened" period. like. they try to open the app to even look at the flows, and it pops up asking for a passcode. none of the other functions matter, since OPENING the app is what i want to stop... as long as it doesn't trigger just when automagic is running or when it pops up a dialog..

what i mean there is i have alarms that pop up "stop alarm? Yes/no" and on yes do stop action sound, on no or timeout make the next alarm sound