Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spotlight plugin > date queries #2140

Closed
bfulop opened this issue Oct 27, 2015 · 1 comment
Closed

Spotlight plugin > date queries #2140

bfulop opened this issue Oct 27, 2015 · 1 comment

Comments

@bfulop
Copy link

bfulop commented Oct 27, 2015

Time variables don't seem to work in the Spotlight plugin query.

This doesn't work: kMDItemLastUsedDate >= $time.this_week
This does: kMDItemKind == 'Folder'

@tiennou
Copy link
Member

tiennou commented Oct 27, 2015

IIRC that's a "limitation" of NSMetadataQuery/NSPredicate. Making a predicate with some "variable" path raises the following error :
NSComparisonPredicate with right expression which is not NSConstantValueExpressionType or NSAggregateExpressionType given to NSMetadataQuery (kMDItemLastUsedDate >= $time.this_week).
(Note this is not from QS but from a test I wrote when I looked at that). So those queries must be manually mangled to become some acceptable predicates, which I didn't feel the will to do.

But then, there is [NSMetadataQuery predicateFromMetadataQueryString:], available 10.9+, thanks Apple ;-).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants