Hook arguably contains the most precise search tool for macOS. Just type ⌘F in Hook and type your search query. As long as you are in the habit of using Hook (for copying links bookmarking, etc.) Hook’s bookmark library contain all the gems you refer to, and none of the cruft that all the other search tools for Mac accumulate and present to you.
Moreover, Hook does not only search for files (though it’s the most precise for doing that), it searches for anything it has dealt with, such as emails, e-books (Apple Books, etc.), DEVONthink items, OmniFocus tasks, Things tasks, web pages (blog posts, etc.) … you name it!
You can search Hook’s database as described next. Background: Whenever you copy a link with Hook, or hook items together, Hook adds a bookmark to its database. So when you search it’s database you are effectively searching for Hook bookmarks. Here’s how to do it.
Enter and Exit Search Mode.
Enter search mode with ⌘F or by clicking 🔍 icon in Hook toolbar. (You can hide/show this toolbar in Hook’s General preferences.
To view Hook’s search field:
- invoke Hook as you normally would (e.g., with ⇧⌘SPACE) ,
⌘F, or click on the 🔍 icon in the Hook window Title bar, or click on the Gear icon and select
Exit search mode
To get out of search mode, back into context mode, you can either
- Gear menu > Show Context, or
- Close Hook Window and reopen it, because the default is always Context-sensitive mode.
Input and execute your search query
Once you’re in the search mode, enter your query in the search field and hit the
return key. Hook’s search currently only starts when you hit
Hook search is not case-sensitive. There is a limit on the number of search results returned by Hook. It’s set to 50. The result is returned in the order of recency and relevancy.
Hook leverages the SQLite FT5 extension to support full text search. Most of the time, you only need to type in a keyword like you do in other search engines. The rest of the section describes some advanced options.
Wildcard matching with *
Currently, Hook only returns search results that exactly match the terms you enter, unless you use a wildcard operator.
So if you want to find all bookmarks containing
Hookproductivity you can’t just type
Hook. But you can type
Hookpro* which will find everything that starts with Hookprod.
For instance, that would return any bookmark containing “hookproductivity” and “Hookpro” in their name or URL.
Restricting search to the bookmark’s attributes.
A Hook bookmark contains four attributes: title, URL, path and name, where the latter two only apply to bookmarks referencing files. You can restrict the search to desired attributes.
For example, if you want to restrict your search to a particular kind of URL you can do so by using the
url: parameter like the following:
- to find bookmarks with
areomain their URL field, such as
*is a wildcard operator as described above.)
- find only emails, you can type:
url:"hook://email"because email URLs have this form:
hook://email. This would also get you in the ballpark:
- to find OmniFocus bookmarks, you could enter
- to find only https bookmarks, you could enter
- to find only bookmarks to files or folders, you could enter
"hook://file"or cast your net a bit wider with
Search for a phrase (exact string)
A phrase is an ordered list of space-separated words. You can concatenate words by using the “+” operator, or enclose the entire phrase in quotation mark.
Omnifocus + Travel
The above two queries are equivalent. They return any bookmark whose one of four properties matches “omnifocus travel”s
Restrict search to URL
you can restrict the search to a URL rather than a name, like this:
that will any bookmark whose URL contains a token that exactly matches
apple, such as
* [Opinion: A sign of our debased times: Vulgarity is on the rise, wit is in decline - The Globe and Mail](https://apple.news/AobozEh0aQnqkQ6K55efm1w) * [Using Hook with Apple Reminders – Hook](https://hookproductivity.com/help/integration/using-hook-with-apple-reminders/) * [Terminal 101: rebuild the Spotlight Index on the fly | TechRadar](https://www.techradar.com/how-to/computing/apple/terminal-101-rebuild-the-spotlight-index-on-the-fly-1305684) * [Universal Links - Apple Developer](https://developer.apple.com/ios/universal-links/) * [App Store Connect](https://appstoreconnect.apple.com/apps/1521721999/appstore/macos/version/inflight) * ['Couldn't have imagined it six months ago,' says Horgan, but scientists have been issuing climate warnings for decades - Vancouver Sun](https://apple.news/AIljwLpjFS7uGnMHH6LUEaw) * [App Store Connect- Feedback from Apple](https://appstoreconnect.apple.com/apps/1521721999/appstore/platform/ios/resolutioncenter?m=) * [Reminders-SVN](hook://file/5nlcWZQBp?p=SU5URUdSQVRJT04vYXBwcw==&n=Apple%20Reminders%2DSVN) * [An6ZIwaY8RTqhN9xslAIYhg](https://apple.news/An6ZIwaY8RTqhN9xslAIYhg) * [App Extension Programming Guide: Share](https://developer.apple.com/library/archive/documentation/General/Conceptual/ExtensibilityPG/Share.html#//apple_ref/doc/uid/TP40014214-CH12-SW1) * [Books.app](hook://application/com.apple.iBooksX) * [Mail.app](hook://application/com.apple.mail)
Restrict search to content of name (i.e., the title)
name: as a keyword will restrict the scope of your search to the name (title) of items
The following will only search for items that have
mov in title.
Here are some possible search Results for above
* [Why Connect Pinboard to Hook - HD 1080p.mov](hook://file/xZFM0zqcu?p=MTQvMDg5QTA2RkYtQTEwMy00ODVCLUI3NTAtRDI2NzNGQTU2RTg3&n=Why%20Connect%20Pinboard%20to%20Hook%20%2D%20HD%201080p%2Emov) * [\[ Sylwia Hyniewska first lecture - PSYC0010_1.mov - Google Drive.ooutline](hook://file/tXQFyHYdC?p=Tm90ZXMvMjAyMQ==&n=%5B%20Sylwia%20Hyniewska%20first%20lecture%20%2D%20PSYC0010%5F1%2Emov%20%2D%20Google%20Drive%2Eooutline) * [How to Connect Hook to Pinboard (shorter ending).mov](hook://file/xF95x5xj4?p=SmF5IE1pbGxlcidzIHNjcmVlbmNhc3RzL3ByZXZpb3Vz&n=How%20to%20Connect%20Hook%20to%20Pinboard%20%28shorter%20ending%29%2Emov) * [Managing Contacts and Meetings with Hook - 4K.mov](hook://file/yHItK89fX?p=U2NyZWVuY2FzdHMgLSBEcm9wYm94L0pheSBNaWxsZXI=&n=Managing%20Contacts%20and%20Meetings%20with%20Hook%20%2D%204K%2Emov) Report generated by Hook on 27-11-2021 12:27.
search for text that appears at the start of a phrase
To only find bookmarks whose URL or name start with a particular string of text, use
that will find URLs starting with OmniFocus.
[Search](hook://file/qbundOUKc?p=SEc=&n=12-SEARCH.txt). For files: the name and path of the file will be displayed in the search results.
that will find bookmarks starting with
Boolean Operators: Conjunction, disjunction, negation
Search criteria can be combined with boolean operators AND, OR, and NOT.
url:^omnifocus AND title:myproject
The above query returns any link with its URL scheme starting with “omnifocus” whose title contains “myproject”
title:Canada OR title:USA
The above query returns any link whose title contains either “canada” or “usa”, case insensitive.
Canada NOT "British Columbia"
The above query returns any link with “canada” but not “british columbia””
Alpha-numeric characters only
Currently, Hook’s search for the most part ignores alpha-numeric characters like “#”.
If you use “special” characters, like
#, Hook’s search might interpret them as special query tokens, as described below.
searching for a decimal number
If you wanted to find the following file that contains “3.2”, you could type:
"3." in the search:
[tap - Hook 3.2 Release QA.taskpaper](hook://file/01EcVOaNa?p=FM&n=tap%20-%20Hook%203.2%20Release%20QA.taskpaper)
or more precisely, yet still concisely, you could search for
tap "3.2" or
If your search expression contains a space, like the one in “Foo Bar”, then Hook will treat each item before and after the space as a word.
Hook is not fussy about word order. So if you search for “foo bar”, then Hook will find all of these items:
foo baz bar.txt
Currently, a quoted search expression, like
"foo bar" will not narrow the search results to items containing the exact sequence
Searching for URLs, revisited
Technically, web URLs have a domain and a path. But Hook’s search does not separate them. So, if you are searching for URLs to a particular website, such as
pdfpen.com, then here are some options
url:"https://pdfpen.com": This includes the scheme, so it won’t find items that merely include pdfpen.com in their URL but not the domain. That is the most precise search, but if you want to type less, here follow some other options.
url:pdfpen: This is quite wide, it will also find any item that has pdfpen in the URL even if they don’t specifically include the
.com. So it would also find
url:"pdfpen.com": this will only find URLs that contain
pdfpen.comin the URL. That’s narrower than #2 but wider than #1. It would also match
ftp://pdfpen.com`, andhttps://nowhere.com/pdfpen.com`. It would not match `https://foopdfpen.com`.
"pdfpen.com". This is a full text search for tokens that exactly match that string, so it might be too wide. It would also find non-web bookmarks that contain
pdfpen.com, and web bookmarks that contain
pdfpen.comelsewhere in the scheme, and files that contain
pdfpen.com. However, in practice it’s faster to type and may be good enough.
Fuzzy matching even without using wildcards
Hook’s search algorithm also has some built in approximate matching. For instance it removes diacritics and it ignores matches some plural forms. So if you search for
pub Hook will show you
pubs.txt if you have bookmarks named with the latter.
More search options
Hook search leverages SQLite FT5 full text extension. For the complete search syntax, please refer to SQLite FTS5 Extension
🔎 Search history
Hook maintains the search history. To see it: click on the 🔎 button at the top of the search input field.
Please note that in order for a search expression to be added to the search history, you need to hit the
return key after typing a search expression.
You can clear the search history by clicking on the 🔎 button at the top of the search input field.