Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.4: Use Automator to remove older files from a folder' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Use Automator to remove older files from a folder
Authored by: DrDoak on Oct 11, '07 09:59:04AM

I also love zsh, but there's an EVEN BETTER way to do this. The original poster warned about the permanent deletion of files using this method. Well, instead we can simplify the bash command down to:

find /path/to/folder/* -type f -mtime +90

AND THEN follow that action up with a "Move to Trash" action (under the Finder Library). It will successfully read the filenames which are returned by the shell script action, and move them all to Trash to be emptied at the user's discretion. Ah, the beauty of AppleScript hooks!

(BTW, if you're looking for directories rather than files, use '-type d' ... to search for both I THINK that this will do it: '-type d -or -type f')
Happy Automating!



[ Reply to This | # ]