Troubleshooting: When Hook hangs in a specific app

If you find that Hook’s contextual window hangs when it is invoked in a specific app, and that app is supported by Hook, but Hook does not hang in other supported apps, it might be due a a macOS caching problem unrelated to Hook.

This has been reported for Preview app and TextEdit.

Please try these steps:

0-A. Modify Hook’s get address script

For Preview issues only, please

  1. Go to Hook Preferences window -> Scripts->Preview->Get Address

  2. Replace Hook’s current Preview.app Get Address script with the following script:

tell application "Preview"
set fpath to path of front document
display dialog fpath
set escapedfpath to do shell script "python -c \"import urllib, sys; print (urllib.quote(sys.argv[1]))\" " & quoted form of fpath
display dialog escapedfpath
return "file://" & escapedfpath
end tell

3. Click the save button
4. Invoke Hook window on a Preview document.

Please let us know:

  1. do you see the first dialog box? what does it say.
  2. do you see a second dialog box? what does it say?

0-B. Modify Hook’s get address script with some ObjectiveC

For Preview issues only, please

  1. Go to Hook Preferences window -> Scripts->Preview->Get Address

  2. Replace Hook’s current Preview.app Get Address script with the following script:

use framework "Foundation"
property NSMutableCharacterSet : a reference to current application's NSMutableCharacterSet
on urlEncode(input)
tell current application's NSString to set rawUrl to stringWithString_(input)
set charset to NSMutableCharacterSet's URLQueryAllowedCharacterSet's mutableCopy
charset's removeCharactersInString:"?"
set theEncodedURL to rawUrl's stringByAddingPercentEncodingWithAllowedCharacters:charset
return theEncodedURL as Unicode text
end urlEncode
tell application "Preview"
set fpath to path of front document
end tell
return "file://" & urlEncode(fpath)

3. Click the save button
4. Invoke Hook window on a document in Preview.

Please let us know:

  • Does the Hook window let you Copy Link in this case, such that you can paste it and use it?

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.