Search

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 https://areomagazine.com/author/hpluckrose/ and https://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

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.

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, and https://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.

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.

UPDATED 2021-05-13 11:10 AM PT. 25% off FLASH sale: checkout coupon code: HOOK-FLASHSALE expires imminently. Our discourse forum is back online too.