If exist

Post your questions and help other users.

Moderator: Martin

Post Reply
Lucy
Posts: 225
Joined: 10 Aug 2019 11:24

If exist

Post by Lucy » 29 Sep 2019 09:17

Heya darling. I read over your replies and i am wanting to reply and go further with my requests at a later time. At present im a lil stuck with something i thought would be fast and easy to create on the fly but i was wrong.
Im trying to make a flow to check if a file in my phone exist or not and if so to do other actions like read it or whatever. I tried a couple simple approaches but failed.
Please show me the light sweetie.

User avatar
Rafi4
Posts: 281
Joined: 01 Dec 2017 05:23

Re: If exist

Post by Rafi4 » 29 Sep 2019 10:15

Hi Lucy
Use action "Init Variables File Info".
Select desired file name. Check file Exists. Use that variable in condition expression. See screen shot.

from record4
Attachments
IMG_20190929_154218-1.jpg
Example screen shot
IMG_20190929_154218-1.jpg (53.54 KiB) Viewed 11189 times
No.1 Automation app in play store Automagic Premium
Samsung Galaxy j2 non rooted.
Android 5.1.1

Lucy
Posts: 225
Joined: 10 Aug 2019 11:24

Re: If exist

Post by Lucy » 29 Sep 2019 11:29

Lol thanks sweetie... i almost had what you gave me but was using wrong techniques

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: If exist

Post by Desmanto » 29 Sep 2019 17:19

If you already have the exact file path to check, simply use expression

Code: Select all

existsFile("/storage/emulated/0/Download/new file.txt");
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Lucy
Posts: 225
Joined: 10 Aug 2019 11:24

Re: If exist

Post by Lucy » 30 Sep 2019 03:02

Yepyep all good darling.. i got it up and running thank you.
Hey can i access the "recent apps list" and if so can i envoke the "swiping or clearing" of the recent apps?

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: If exist

Post by Desmanto » 01 Oct 2019 17:24

To get the result in string and reliable, you have to use execute root command, using the dumpsys command.
But if you only want to clear the recent app, you can use Control UI recents() and then find the command to swipe it out.
It is different in each ROM, so the script will be device-specific, not the same in all device.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Post Reply