Page 1 of 1

Tweaking help

Posted: 25 Aug 2019 15:20
by Lucy
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.

Re: Tweaking help

Posted: 25 Aug 2019 18:08
by Desmanto
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);

Re: Tweaking help

Posted: 25 Aug 2019 21:26
by Lucy
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