Advanced, Command-line Preferences

Hook has a growing list of esoteric preferences for advanced users. They can currently only be manipulated from the command line, using /Applications/Utilities/Terminal.app

summary

Control Foreground/background mode of operation

Hook 3.3 defaults to background mode. However, you can now run Hook in foreground mode. This can be achieved by using the command line (/Applications/Utilities/Terminal.app) :

defaults write com.cogsciapps.hook background.app.mode 0

In foreground mode, you will see Hook in:

  • the App Switcher app (⌘TAB),
  • the Force Quit app, and
  • the Dock (which means you can click on Hook’s icon in the Dock to activate Hook)

When you bring the Hook app to the foreground (i.e., “switch” to it), you will see

  1. Hook’s search tool (which is context agnostic)
  2. Hook’s own menu bar.

Many of the gear commands are now available from there, like a traditional (foreground) app: Preferences, About Hook.

There are also new commands, such as:

  • File > Show Hook folder
  • File > Show Notes folder

We expect to provide significant new commands to Hook’s new menu bar 😊 .

When Hook app is in the foreground, you don’t see Hook’s contextual window. If you use LaunchBar, then you’ll recognize that this setting is quite similar to LaunchBar’s Show Dock Icon preference.

Of course, you can still bring Hook’s contextual window to the foreground, with the same commands as before.

Regardless of whether you use foreground or background mode, Hook’s contextual window remains the main way of using Hook, invoked with a keyboard shortcut or menu bar icon > “Show Hook” command.

Control the hook://file/ scope of searches used in (Advanced)

Sometimes Hook needs to rely on Spotlight to resolve some of its file links ( hook://file/ URLs). You can control the scope of Hook’s Spotlight search.

Hook 3.3.2 introduced an advance preference to work around a macOS 12 bug that cause Hook to beachball for some users. The preference restricts the scope of Hook’s search when resolving hook://file/ URLs. macOS Monterey users who find that Hook hangs can set the variable below to “user” (as opposed to “local” or “network). That should fix the problem.

From Apple’s Terminal app, i.e. /Applications/Utilities/Terminal, you can now set the hook://file/ search scope to user, local or network with one of the following incantations, respectively:

defaults write com.cogsciapps.hook hfile.url.search.scope user
defaults write com.cogsciapps.hook hfile.url.search.scope local
defaults write com.cogsciapps.hook hfile.url.search.scope network

Hook sometimes relies on the Spotlight index to resolve hook://file/ URLs. The hfile.url.search.scope variable controls the Spotlight parameters used by Hook. The default scope value is local (which searches “the whole Mac”, not just “user”). That is the same as was introduced in Hook 3.3. Before Hook 3.3, the value was user (search only “home directory”), which could prevent Hook from finding files outside the home directory. The “network” value includes everything in “local”, plus network drives.

This is an advanced preference as most users are unlikely to need it.

Control monitor on which Hook window is displayed

🖥️ As of Hook 3.4, Hook works better with additional monitors (displays). Without requiring additional configuration, Hook will better remember on which monitor it was positioned and where. Its position is dependent on the window that has the focus. When you invoke Hook, it will appear on the monitor on which the last window had focus. Change the focus by clicking on a different window, or selecting a different window by other means.

In addition, @Rigorjunky on the Hook productivity forum requested:

I would like to be able to pick which screen it appears on (main vs screen with current window).

So we added that to Hook 3.4 too. To be able to manually control on which display Hook is presented, regardless of what window has the focus, from Terminal.app, write:

defaults write com.cogsciapps.hook hook.window.position.ignore.key-focus 1

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.