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)
open automagic = action
Moderator: Martin
Re: open automagic = action
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
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
You should use ORMURTUMA wrote:"top_activity == class name 1 AND top_activity == class name 2 AND top_activity == class name 3"
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.
Re: open automagic = action
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.
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
I mean that
wouldn't work
It must be
(false branch) or
(true branch)
Because you can't be sure that top_activity is equal to two or more different activities at the same time
Code: Select all
top_activity == "class name 1" AND top_activity == "class name 2" AND top_activity == "class name 3"
It must be
Code: Select all
top_activity == "class name 1" OR top_activity == "class name 2" OR top_activity == "class name 3"
Code: Select all
top_activity != "class name 1" AND top_activity != "class name 2" AND top_activity != "class name 3"
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.
Re: open automagic = action
Yeah, it seems like you're right. My bad... :/
Re: open automagic = action
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
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