Tweaking help

Post your questions and help other users.

Moderator: Martin

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

Tweaking help

Post by Lucy » 25 Aug 2019 15:20

If i set a flow to auto zip files from numerous directories, how do i add an exception to miss directories that have no files to zip? Currently the flow just ends with errors at the point that it does not find any files.

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

Re: Tweaking help

Post by Desmanto » 25 Aug 2019 18:08

How do you define the list of the files to be zipped? In a list object? If it is a list, you can loop check existFile() to each element and remove them from list if it doesn't exist. Or the easier logic is to add them to newList() if exists (since you can't remove element when looping). After the loop, the files only the ones those exist.

Code: Select all

ziplist = newList(
"/storage/emulated/0/Automagic/flows.xml",
"/storage/emulated/0/Automagic/widgets.xml",
"/storage/emulated/0/Automagic/variables.bin",
"/storage/emulated/0/Automagic/Resources",
"/storage/emulated/0/Automagic/Not Exist");

checkedlist = newList();
for(i in ziplist)
  if(existsFile(i)) addElement(checkedlist, i);
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: Tweaking help

Post by Lucy » 25 Aug 2019 21:26

Hmm.. thanks i will see if i can fidle with that. I dont know android scripting. I use this app in its simplest form from the selections available, (trigger, action and condition). I have a basic understanding because in hay day i have wrote several scripts in j2me and c++ but yeah i will see what i can do

Post Reply