Do you know what, I’m not sure whether that is true. There is no obvious date (e.g. added or modified) which would show when the record was moved to trash. Without that automatic deletion after a period of time is not possible. The only way I could think of doing this would be to use custom metadata (one smart rule to set the custom metadata to the current date, one to delete any file whose custom date is not within the last 30 days and is different to the generic date 1.1.2001); however, I have just checked: smart rules cannot be set to act on location Trash. So we’d be back to scripting…
I download a file from the Web, and the file goes to the Download folder on the Mac.
Then I move the file into DT3, but the original file is still in the original folder, so I have to delete it by hand.
Attached is a simple reminder script you can attach to the Inbox of a database. (Technically you can attach it to any item in a database, but the Inbox is ever-present so it’s an easy option to take!)
property maxDate : 30
on performReminder()
tell application id "DNtp"
set currentDate to (current date)
set trashedKids to (children of trash group of (current database)) -- of every database
if trashedKids ≠ {} then
repeat with thisKid in trashedKids
set dateAdded to (addition date of thisKid)
set dateDifference to (((currentDate - dateAdded) / 3600) / 24) as integer
if dateDifference > maxDate then
delete record thisKid
end if
end repeat
end if
end tell
end performReminder
`1``
Jim, is the addition date not the date the record was added to the database rather than the date the record was moved to the trash group of that database?
So bear with me here, doesn’t that mean that the script will delete any record which was added to the database more than 30 days ago, rather than to the trash? Sure, if the scope is limited to the Trash, then no immediate harm is done, but it still doesn’t do what the OP was asking after. Or am I missing something?