Use OR Operator in Mac OS X’s saved searches (smart folders)

By default, you can’t set Mac OS X’s saved searches to concatenate several queries using ‘or’ but only using ‘and’.

To change this, create a saved search using ‘and’ connectors, save the search and open it in a text editor.

Then, change all occurences of “&&” to “||”.

Make sure to not change the first occurence (true) &&

e.g.:

    <key>RawQuery</key>
    <string>(true) &amp;&amp; (((kMDItemDisplayName = “*A*”cd) &amp;&amp; (kMDItemDisplayName = “*B*”cd)))</string>

to

    <key>RawQuery</key>
    <string>(true) &amp;&amp; (((kMDItemDisplayName = “*A*”cd) || (kMDItemDisplayName = “*B*”cd)))</string>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: