Search

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:

  1. invoke Hook as you normally would (e.g., with ⇧⌘SPACE) ,
  2. type ⌘F, or click on the 🔍 icon in the Hook window Title bar, or click on the Gear icon and select Find

Exit search mode

To get out of search mode, back into context mode, you can either

  1. type ⌃⌘F,
  2. Gear menu > Show Context, or
  3. 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 return.

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.

Search syntax

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:

  1. to find bookmarks with areoma in their URL field, such as areomagazine.com/author/hpluckrose and areomagazine.com/2019/04/18/why-do-conservatives-dislike-immanuel-kant type: url:areomag* . ( * is a wildcard operator as described above.)
  2. 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: "url:/email"
  3. to find OmniFocus bookmarks, you could enter url:"omnifocus://"
  4. to find only https bookmarks, you could enter url:"https://"
  5. to find only bookmarks to files or folders, you could enter "hook://file" or cast your net a bit wider with url:"file/"

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.

Examples:

  • "omnifocus Travel"
  • 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 ^.

Examples:

url:^OmniFocus

that will find URLs starting with OmniFocus.

url:^hook

such as [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.

name:^Hook

that will find bookmarks starting with Hook.

Boolean Operators: Conjunction, disjunction, negation

Search criteria can be combined with boolean operators AND, OR, and NOT.

Examples:

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 Rel* "3.2".

Tokenized search

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 bar.txt
  • bar foo.txt
  • foo baz bar.txt

Currently, a quoted search expression, like "foo bar" will not narrow the search results to items containing the exact sequence "foo bar".

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

  1. 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.
  2. 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 https:pdfpen.ca and `https://nowhere.com/pdfpen/foo`.
  3. url:"pdfpen.com": this will only find URLs that contain pdfpen.com in 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`.
  4. "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.com elsewhere 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 and 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

Using launchers (ObDev’s LaunchBar app or Alfred app)

Another way to search Hook’s bookmarks is to use launchers, as described here.. Easier and more precise is the new Fastmarks app for macOS by Tyler Hall, which will soon support Hook.

Hook Productivity App Newsletter

Sign-up to receive emails about Hook productivity app. Our emails sometimes include coupons for discounts on great Hook-linkable apps made by other developers.





 Marketing permission: I give my consent to to be in touch with me via email using the information I have provided in this form for the purpose of news, updates and marketing.

What to expect: If you wish to withdraw your consent and stop hearing from us, simply click the unsubscribe link at the bottom of every email we send or contact us at support@cogsciapps.com. We value and respect your personal data and privacy. To view our privacy policy, please visit our website. By submitting this form, you agree that we may process your information in accordance with these terms.