I love the Hook to New feature in Hookmarks, as I can create support materials straight from a project in Omnifocus, avoiding a lot of manual steps. However, I use Devonthink, and if you create a new item and then have it imported into DT, it loses the hook (since Devonthink essentially makes a copy then destroys the original instead of just moving it).
There’s also the downside that you can only have one set of Hook to New scripts per app in Hookmarks (afaik) so it would only support one type of file anyway. I like to use mindmaps, markdowns, kanbans, spreadsheets and so on, according to my need.
A workaround I’ve come up with is to use Applescript to create a new item based on the templates folder in Devonthink. I’ve then populated my templates folder with all the various document types that I might want to link to Omnifocus.
When you run the Applescript it offers you a pop-up showing you your Templates. You then choose the relevant template and it will create the file, rename it and Hook it.
set thePath to "/Users/[Your User]/Library/Application Support/DEVONthink 3/Templates.noindex"
tell application "System Events"
set templateList to {name, POSIX path} of every disk item of folder thePath
end tell
tell application id "DNtp"
set theTitle to "$title"
set theTemplate to choose from list templateList's item 2
set newItem to import template (theTemplate as string) to incoming group of current database
set name of newItem to theTitle
set refURL to reference URL of newItem
set itemPath to path of newItem
end tell
open location refURL
get refURL
Limitations
- I have no idea what I’m doing with Applescript and just fudged my way through the above. If you, dear reader, can retype this script more succinctly, that would be very welcome.
- Just shows you the path and filename of each template. A nicer list of templates would be great.
- This doesn’t permit you to put any content within the file itself, as currently happens with the rtf and md files. No idea if that’s possible.
- The list of templates won’t work recursively down into any sub-folders. This is possible, I just haven’t bothered to do it yet since I don’t use enough templates to make it worth it.
With thanks to this post on the DT forum Creating new file from template folder by AppleScript - Automation - DEVONtechnologies Community