How to code rules to do the Trash logic on another folder?

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Hi there

I'm using MailMate and it saves the attachments from mail messages in a fix location ~/Library/Application Support/MailMate/Attachments/. I want to clean out the files and folders in this location regularly with a logic similar to what Hazel already does for the Trash: Delete files sitting in the Trash for 6 months.

How can I code rules for this?

Many thanks,
Leo
halloleo
 
Posts: 44
Joined: Thu Apr 27, 2017 10:10 pm

In general, it's a bad idea to have Hazel process the internal files of another application. I would contact the developer of MailMate to make sure it won't affect operation.

If it's ok, then something like "Date added is not in the last 6 months, Move to trash" would probably work.
Mr_Noodle
Site Admin
 
Posts: 11193
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Thx for your prompt repsonse!

Yes, the folder is a place were MailMate caches attachments for quicklook. So apart from Date added, the date last opeend is important too.

How do the dates "Date added" and "Date Last opened" related to the normal file stats "Date created", "Date last accessed" and "Date last modified"?
halloleo
 
Posts: 44
Joined: Thu Apr 27, 2017 10:10 pm

Date added is when the file was added to that folder. Date opened is when it was last opened.
Mr_Noodle
Site Admin
 
Posts: 11193
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Thanks Paul.

BTW, I had a look around for clarification between "Last opened" Metadata and "Last accessed" file stats, I and found a great blog post for this: MacOS Timestamps from Extended Attributes and Spotlight | Forensic 4cast

Bottom line: "Last accessed" is trigger even by system events like indexing, "Last opened" is (hopefully) only set when the user opens the file.
halloleo
 
Posts: 44
Joined: Thu Apr 27, 2017 10:10 pm


Return to Support