I’m pretty sure this is possible, but I couldn’t work it out.
I’d like to be able to automate “Hook to New” to a specific app. For example, I’d like to be able to press a button on Keyboard Maestro and do a “hook to new” omnifocus task.
The easiest way feels like using Applescript, but I couldn’t see a “hook to new” item in the Applescript dictionary.
I think the major advantage of hook is its huge variety of scripts for integrating with individual products like OmniFocus.
What I’m trying to do is programatically link something (for example, a DevonThink document) to an OmniFocus task, with one button press.
This can be done in many keypresses / clicks (e.g. open hook, do Hook to New, scroll down, find Onifocus in the list) but isn’t automation friendly.
It sounds from your reply as if I can use the building blocks and existing hook integrations to do this with Applescript. Could you point me to a guide?
A great starting point would be to hook any hookable item to an Omnifocus task; but ideally this would be easy to adapt to any item in the Hook to New list.
Hook to New is not currently exposed in the AppleScript because it can be composed from other actions in Hook’s AppleScript dictionary. But I agree it would be simpler for users if we were to expose it directly.
sorry for the long delay, this one fell off our radar. Unfortunately we don’t have extra documentation on this yet. We plan to share some other AppleScript that users can use as reference models as a start. There’s a bit of documentation in the AppleScript dictionary itself.
I’ve logged an issue internally to resume the discussion on Hook to New in the API, given that Hook to New now does quite a bit more than when we first released the API ( AppleScript dictionary).