Sunday, July 22, 2018

#1 2005-08-31 07:16:11 pm

From:: FL
Registered: 2005-09-01
Posts: 1

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,

iBook 600 MHz, 640 RAM, 60 GB HD
OS X 10.4.2



#2 2005-09-16 02:56:29 pm

Trash Man
Sanitation Department
Registered: 2005-10-20
Posts: 5336

Re: move to trash, selectively

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:

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.

One mans trash is another mans treasure



Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)