Hook to new, via applescript

Hi,

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.

What would be the best way to do this?

Thanks

Tom

I’d love to be able to do this from Applescript. Is it possible?

Tom

You can create new bookmarks and link them like this:

I don’t know if there’s a convenience method to do it more easily.

sorry for the delay in responding. Hook’s API is meant to provide the building blocks. Hook to New can be assembled from the building blocks.

1 Like

Apologies for the delay replying!

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.

2 Likes

Is it possible to do Hook to new using one of Hook’s built-in templates via AppleScript? Or with a custom template?

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).