I was developing a flow in which I used delete folder action!
But it ended up in error as file/folder doesn't exist!
I want to check if or not file/folder exist before I perform any action on it, so as to avoid error!
How do I go about this thing, I found no condition for this?
Is there a way to check file / folder?
Moderator: Martin
Re: Is there a way to check file / folder?
Hi
Check, if trigger "File observer" with checked "Delete Self" event type suits your needs
http://automagic4android.com/en/help/co ... e_observer
Check, if trigger "File observer" with checked "Delete Self" event type suits your needs
http://automagic4android.com/en/help/co ... e_observer
Regards, piskor
-
- Posts: 18
- Joined: 07 Dec 2013 05:59
Re: Is there a way to check file / folder?
Really appreciate your help!
But than no use I have to create different flow for this!
I want to use it main flow without modifying trigger!
Any condition or script that could do?
But than no use I have to create different flow for this!
I want to use it main flow without modifying trigger!
Any condition or script that could do?
piskor wrote:Hi
Check, if trigger "File observer" with checked "Delete Self" event type suits your needs
http://automagic4android.com/en/help/co ... e_observer
Re: Is there a way to check file / folder?
You can create new flow with file / folder availability check, and inside it set global variable to true if file / folder is available and then check this variable in first flow
It should looks like this:
First flow:
Your trigger
your commands
"Execute flows": second_flow_with_file_availability_check - this one sets global variable, for example global_file_av
Now you can use condition "Expression" with expression set to:
global_file_av == true
If true than delete folder
If false - stop thread or do something else
It should looks like this:
First flow:
Your trigger
your commands
"Execute flows": second_flow_with_file_availability_check - this one sets global variable, for example global_file_av
Now you can use condition "Expression" with expression set to:
global_file_av == true
If true than delete folder
If false - stop thread or do something else
Regards, piskor
-
- Posts: 18
- Joined: 07 Dec 2013 05:59
Re: Is there a way to check file / folder?
Ok yup
Thanks
Thanks
piskor wrote:You can create new flow with file / folder availability check, and inside it set global variable to true if file / folder is available and then check this variable in first flow
It should looks like this:
First flow:
Your trigger
your commands
"Execute flows": second_flow_with_file_availability_check - this one sets global variable, for example global_file_av
Now you can use condition "Expression" with expression set to:
global_file_av == true
If true than delete folder
If false - stop thread or do something else
Re: Is there a way to check file / folder?
Hi again
I have found better and faster solution without need for another flow
Use action "Execute command" with command:
test -d /storage/emulated/0/DCIM && echo 1 || echo 0
stdout variable will be set to 1 if /storage/emulated/0/DCIM folder in this example is available or set to 0 if it is not available
you can change stdout variable name if you want and than check it using condition "Expression" as I proposed earlier
I have found better and faster solution without need for another flow
Use action "Execute command" with command:
test -d /storage/emulated/0/DCIM && echo 1 || echo 0
stdout variable will be set to 1 if /storage/emulated/0/DCIM folder in this example is available or set to 0 if it is not available
you can change stdout variable name if you want and than check it using condition "Expression" as I proposed earlier
Regards, piskor
-
- Posts: 18
- Joined: 07 Dec 2013 05:59
Re: Is there a way to check file / folder?
Amazing job bro!
Automagic is also amazing..
Automagic is also amazing..
piskor wrote:Hi again
I have found better and faster solution without need for another flow
Use action "Execute command" with command:
test -d /storage/emulated/0/DCIM && echo 1 || echo 0
stdout variable will be set to 1 if /storage/emulated/0/DCIM folder in this example is available or set to 0 if it is not available
you can change stdout variable name if you want and than check it using condition "Expression" as I proposed earlier
Re: Is there a way to check file / folder?
I am using AM since one month and i'm still learning and looking for best solutions
Regards, piskor
-
- Posts: 18
- Joined: 07 Dec 2013 05:59
Re: Is there a way to check file / folder?
It's an amazing tool. But drains lots of battery.
I also started some years back, but due to battery issue left it, but now again back as got new mobile.
And now it seems to work better.
I also started some years back, but due to battery issue left it, but now again back as got new mobile.
And now it seems to work better.
piskor wrote:I am using AM since one month and i'm still learning and looking for best solutions