Recurse subfolders and then delete

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Recurse subfolders and then delete Wed May 31, 2017 1:08 pm • by jeffvogelsang
Hello,

I have a rule that's meant to watch a folder, and as things are added grab files an import them into another program using AppleScript, and then delete the files. I can successfully process all the files with no problems. (I read: https://www.noodlesoft.com/kb/going-into-subfolders/)

A problem I am having is that the process that is dropping off files creates a directory structure and I can't change that. What I also want to do is delete the folder structure in the monitored folder after I import and delete all the files.

To sum, I want to:

1. Monitor a folder.
2. Watch for files and folders.
3. Run an AppleScript on all files.
4. Delete files after the AppleScript runs.
5. Delete the folders after all the files have been processed and deleted in each folder.
6. Have an empty monitored folder when I'm done.

I can't seem to figure out how to get 5 and 6 done.

Thanks,

Jeff
jeffvogelsang
 
Posts: 1
Joined: Wed May 31, 2017 11:26 am

Re: Recurse subfolders and then delete Thu Jun 01, 2017 11:03 am • by Mr_Noodle
Search for "subfolders" in the help. The updated chapter touches on this directly.
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support