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
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
Search with starting 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