You can do this with the Locale Execute Plugin...
Change "DIRECTORY" to the exact directory. For example, if it's a
directory named "stuff" on the sdcard use /sdcard/stuff. I'm using /
sdcard/test.txt as a temp file. You can change it or you can delete it
at the end of the task.
1- Write File: test.txt Text: WAIT
2- Execute: @ [ -d DIRECTORY ] && echo ok > /sdcard/test.txt || echo
no > /sdcard/test.txt
3- Read Line test.txt to %YESORNO
4- GoTo 3 if %YESORNO matches WAIT
%YESORNO will be "yes" if the directory exists and "no" if it doesn't,
so then you delete the directory if %YESORNO matches yes.
If you need this for several tasks, then make this it's own task,
let's call it "CheckDir", and use this line for the Locale Execute
Plugin:
@ [ -d $(cat /sdcard/dir.txt) ] && echo ok > /sdcard/test.txt || echo
no > /sdcard/test.txt
This will look in the file /sdcard/dir.txt for the name of the
directory you want to check. In your main task, just add these lines:
Write File: dir.txt Text: (the directory you want to check)
Perform Task: CheckDir
delete stuff if %YESORNO matches yes.
If you only need this once, the first method is simpler but the
directory is hard coded. The second method allows the directory to be
variable and you can re-use the task instead of recreating the whole
task for different directories.
Hope this all makes sense.