move to trash, selectively

I’ve been lookin around/experimenting with Automator quite a bit to find:

a way to monitor a folder (some kind of Folder Action) so that when files are older than a certain amount (IE 14 days), they are moved to the trash.

seems simple enough, but all the queries in Automator don’t come near this type of filter. would i need to incorporate an applescript or a shell script. i’m vaguely familiar with Applescript (obviously not enough if that’s where the answer lies), but not at all with shells.

so, does anyone have any idea how i can solve this?

thanks much,
matt

I am in a similar position. I have dabbled in AppleScript over the years and I struggled with Automator. After reading your post I stumbled across the following Apple support pages:

www.apple.com/applescript/folderactions/index.html

It talks through creating AppleScripts as parts of folder actions. Now, I’m no AppleScript genius (I can’t even remember the syntax) but I’m sure you could take the “file added” folder action example and add something like:

for each file in folder
if date of file is more than 14 days old then delete it

I shall be working on a folder action to remove all but the most recently added file. Good luck with your project.
:slight_smile: