File by how many times a file has been accessed?

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

Moderator: Mr_Noodle

I'm thinking about buying Hazel, but I don't think it can duplicate my manual filing.

My system is to order my downloads directory by recent, and then only keep stuff that I've accessed THREE TIMES or MORE.

The thing is, I don't think anything records how many times a file has been accessed, so I have to do it from memory.

I'm not even sure if MacOS tracks this, so Hazel would have to monitor the DATES accessed and see when they change.
Omission1278
 
Posts: 2
Joined: Fri Oct 27, 2023 8:04 am

Spotlight does sometimes record the last used dates as a list. It's under the kMDItemUsedDates key. You might be able to write a script to dump the Spotlight metadata with 'mdls', look for that field and process it accordingly.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:Spotlight does sometimes record the last used dates as a list. It's under the kMDItemUsedDates key. You might be able to write a script to dump the Spotlight metadata with 'mdls', look for that field and process it accordingly.


It seems sometimes not enough, but thanks for the lateral thinking :-) I just get

Code: Select all
➜  Teach mdls */*.pdf |grep kMDItemUsedDates
kMDItemUsedDates                       = (
kMDItemUsedDates                       = (
Omission1278
 
Posts: 2
Joined: Fri Oct 27, 2023 8:04 am

I think the entry spans multiple lines so you probably want grep to output lines after that.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support