Skip to content

Handle the $ variables in Spotlight queries #2141

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

Merged
merged 2 commits into from
Oct 30, 2015
Merged

Conversation

tiennou
Copy link
Member

@tiennou tiennou commented Oct 27, 2015

Fixes #2140

@pjrobertson
Copy link
Member

Latest QS is 10.9+ right?
In that case we need to change this line

Don't see anything wrong with this though, as long as it doesn't break existing Spotlight Query stuff

@pjrobertson
Copy link
Member

...is it worth adding unit tests for doing a query with the two examples given in #2140 ? :-)

@skurfer
Copy link
Member

skurfer commented Oct 27, 2015

Latest QS is 10.9+ right?
In that case we need to change this line

That’s already changed in #2096 and #2104. No need to do it a third time. 😃

@skurfer
Copy link
Member

skurfer commented Oct 29, 2015

I wonder why this doesn’t like * now…

2015/10/29 12:11:33.956 AM Quicksilver[605]: An error ocurred while scanning "Comment Tags": Syntax error in Metadata query string: kMDItemFinderComment LIKE[cd] '*#*'
2015/10/29 12:11:33.959 AM Quicksilver[605]: An error ocurred while scanning "Yojimbo Items and Tags": Syntax error in Metadata query string: kMDItemKind LIKE 'Yojimbo*'

@pjrobertson
Copy link
Member

Looks like NSPredicate and Spotlight use different syntax :(

https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/Predicates/Articles/pSpotlightComparison.html

Edit: but still, that doesn't explain why it did work before, and not now.

@tiennou
Copy link
Member Author

tiennou commented Oct 29, 2015

@pjrobertson Thanks, I knew there was some differences between the 2 syntaxes but wasn't able to find the actual documentation.

@skurfer Was this running the fix or the master version ?

@skurfer
Copy link
Member

skurfer commented Oct 29, 2015

that doesn't explain why it did work before, and not now.

I don’t see them using single quotes in any of the examples. Maybe that’s the problem, and not the asterisk.

Was this running the fix or the master version ?

The queries work with master, but fail with this change.

@tiennou
Copy link
Member Author

tiennou commented Oct 29, 2015

Differences are that NSPredicate mandates quoting constants and its LIKE clauses are not the same. We can fix that by making it try both syntaxes, but meh.

skurfer added a commit that referenced this pull request Oct 30, 2015
Handle the $ variables in Spotlight queries
@skurfer skurfer merged commit 23d4c04 into master Oct 30, 2015
@skurfer skurfer deleted the t/spotlight-queries branch October 30, 2015 12:56
skurfer added a commit that referenced this pull request Oct 30, 2015
@skurfer
Copy link
Member

skurfer commented Oct 30, 2015

is it worth adding unit tests for doing a query with the two examples given

Along with a few others? Yes. I put it on my Remember the Milk Quicksilver list.

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

Successfully merging this pull request may close these issues.

3 participants