open automagic = action

Post your questions and help other users.

Moderator: Martin

Post Reply
evebrea
Posts: 116
Joined: 12 Aug 2013 15:28

open automagic = action

Post by evebrea » 10 Feb 2015 20:57

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)

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: open automagic = action

Post by MURTUMA » 11 Feb 2015 03:37

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

User avatar
Nerey
Posts: 102
Joined: 07 Mar 2014 16:59

Re: open automagic = action

Post by Nerey » 12 Feb 2015 10:11

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?
Sorry for bad english, my native is russian.

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: open automagic = action

Post by MURTUMA » 12 Feb 2015 22:16

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.

User avatar
Nerey
Posts: 102
Joined: 07 Mar 2014 16:59

Re: open automagic = action

Post by Nerey » 13 Feb 2015 05:32

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
Last edited by Nerey on 15 Feb 2015 09:46, edited 1 time in total.
Sorry for bad english, my native is russian.

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: open automagic = action

Post by MURTUMA » 14 Feb 2015 15:04

Yeah, it seems like you're right. My bad... :/

evebrea
Posts: 116
Joined: 12 Aug 2013 15:28

Re: open automagic = action

Post by evebrea » 18 Feb 2015 05:38

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

Post Reply