Recurse subfolders and then delete

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
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