select folders with sub-folders
Posted: 08 Jun 2018 18:06
sometimes i have to select folders that contain at least 1 sub-folder
after spending many hours (during several days) on this task, i now have a working script (it uses 1 search template)
the "search templates #264" command contains this template:
- title: keep folders with sub-folders
- find files > name and location > name:- applied filters: name
- auto sync: yes
- there are no more ticks in the "name and location" tab
so this is the script:not ideally (and not immediately) but looks like it works
but there are several issues:
- not very big issue: a folder without sub-folders gets selected anyway: in case it contains a file without the dot+extension
- more serious issue: a folder with sub-folders remains unselected: in case it contains 3 (or more) sub-folders with dots in their titles
and i don't understand why does 3 is a problem? (while 2 is not)
is there a better/simplier/more reliable way to select folders that contain at least 1 sub-folder?:
- with 1 click
- without the "dot problem"
- without searching/filtering or paper folders that i don't use
- for example, just like the "select all" command works (immediate and always correct result without flickering)
with no big success i initially tried many various approaches including:this variant works but only partially (with small quantity of folders)
the following error appears in case there are ~100 folders: error 6, desc: overflow, proc: script_Process: selectitems
and for example the "/d" never worked as expected (during my attempts)
after spending many hours (during several days) on this task, i now have a working script (it uses 1 search template)
the "search templates #264" command contains this template:
- title: keep folders with sub-folders
- find files > name and location > name:
Code: Select all
!. /p /md=1 /matching=e- auto sync: yes
- there are no more ticks in the "name and location" tab
so this is the script:
Code: Select all
searchtemplate("keep folders with sub-folders", , 8); wait 10; #250; wait 10; #101; wait 10; #485; wait 10; #481; wait 10; selectitems "<clp>", 2but there are several issues:
- not very big issue: a folder without sub-folders gets selected anyway: in case it contains a file without the dot+extension
- more serious issue: a folder with sub-folders remains unselected: in case it contains 3 (or more) sub-folders with dots in their titles
and i don't understand why does 3 is a problem? (while 2 is not)
is there a better/simplier/more reliable way to select folders that contain at least 1 sub-folder?:
- with 1 click
- without the "dot problem"
- without searching/filtering or paper folders that i don't use
- for example, just like the "select all" command works (immediate and always correct result without flickering)
with no big success i initially tried many various approaches including:
Code: Select all
$cf = quicksearch("!. /p /md=1 /lpd=1 /matching=e");
selectitems "$cf";the following error appears in case there are ~100 folders: error 6, desc: overflow, proc: script_Process: selectitems
and for example the "/d" never worked as expected (during my attempts)