matching attribute kMDItemDownloadedDate

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

Moderator: Mr_Noodle

matching attribute kMDItemDownloadedDate Mon Jul 29, 2013 1:56 pm • by bobert
I don't see a way to match kMDItemDownloadedDate directly in a rule? Not even the "Other..." has this attribute available. Is there a way to add any arbitrary spotlight attribute to Other...?
bobert
 
Posts: 3
Joined: Tue Jun 25, 2013 2:53 pm

Re: matching attribute kMDItemDownloadedDate Mon Jul 29, 2013 3:51 pm • by sjk
Try "Date Added" under "Other…".
sjk
 
Posts: 332
Joined: Thu Aug 02, 2007 5:43 pm
Location: Eugene

Re: matching attribute kMDItemDownloadedDate Mon Jul 29, 2013 5:15 pm • by bobert
Thanks, but that didn't work. Looks like "Date Added" is associated with kMDItemDateAdded. I think this is the same as 'Date Added' in Hazel's one of rule conditions. There is also Content Date Added, but that seems to be same as file's added date. That doesn't work because it tends to be of the original file's date, not the downloaded date.

Downloaded Date is stored as com.apple.metadata:kMDItemDownloadedData as binary plist.
bobert
 
Posts: 3
Joined: Tue Jun 25, 2013 2:53 pm

Re: matching attribute kMDItemDownloadedDate Mon Jul 29, 2013 9:53 pm • by sjk
That looks right; I'd botched my earlier test. :oops:

Maybe you could work around the missing kMDItemDownloadedDate attribute in Hazel (and Spotlight searches) using Raw Query, e.g.:

Code: Select all
kMDItemDownloadedDate >= $time.today(-7)

… to match files downloaded within the last 7 days.

bobert wrote:Is there a way to add any arbitrary spotlight attribute to Other...?

Third-party Spotlight plug-ins do it, e.g.:

Code: Select all
% mdimport -A | grep -i dvdpedia
'com_bruji_pediaimporter_dvd_director'      'Director'      'DVDpedia movie director'      '(null)'
'com_bruji_pediaimporter_dvd_starring'      'Starring'      'DVDpedia movie cast'      '(null)'
'com_bruji_pediaimporter_dvd_studio'      'Studio'      'DVDpedia movie studio'      '(null)'
'com_bruji_pediaimporter_dvd_theatrical'      'Release'      'DVDpedia movie release date'      '(null)'

The second/third fields are the "Other" Attribute/Description displayed in a Spotlight search (called Name/Description in Hazel).

Writing code for one is out of my league. I'm challenged enough just trying to construct more than a basic Raw Query, which is why my earlier example is weak.
sjk
 
Posts: 332
Joined: Thu Aug 02, 2007 5:43 pm
Location: Eugene

Oddly, even though I can see it set for some files, I can't find it in the list of Spotlight attributes. It doesn't seem to show up in Spotlights UI either. I think for the time being you're best off using a script using sjk's info as a start.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support