I’am a new user of DevonThink and would like to realize a macro that creates a markdown note and opens it in Typora. I used Keyboard Maestro and it worked up to the point there the document is created.
But now i cannot figure out how i can open the newly created document in Typora - because i do not know how to fetch the file patch of the recently created MD?
Any help would be greatly appreciated - many greetings
Unfortunately i’am not sure - “Open File” or “Open URL” ?
In both cases i tried inserting the devonthink-Link - but that is not identical to the file path - only a link back into Devonthinks UI.
would this work? set up a keyboard shortcut for “Typora” in system preferences/keyboard/shortcuts/app shortcuts (click +, add a shortcut for DEVONthink, using the exact name of the entry for Typora in the DEVONthink data/open with/ menu. Then trigger that shortcut with KM? Obviously that will only work if the new document is highlighted/selected.
(I don’t use KM and would be doing what you describe with a smart rule & script, I guess; but all roads lead to Rome :))
There is only one hurdle left - the document needs to be selected within devonthink. Currently if i run the script it opens Typora (yay!!!) - but only some randomly selected document. How can i program it so that the newly created markdown is selected, and then opened?
If i run the script in the current state it opens a document in the global inbox in Typora
but not the newly created markdown text. So i thought it makes sense to select the newly created markdown and then open it.
If I read your rule correctly, then the title of the document will always contain certain defining features; so let’s set up a smart rule which opens the document externally on creation. So, only create the document with KM, then open it from within DT. If Typora is not the app associated with MD, then the rule needs to change to open specifically with Typora (which I think would require a line of script).
Obviously you need to use the location where the item is being created (e.g. in the inbox) as the search location for the script, and whatever defining features the item has (e.g. name contains, size is, kind is…).
Why are you using the URL command?
Bear in mind that is not an x-callback URL (which are not supported in DEVONthink), so it’s not going to return a value.
thanks for your idea with the smart rule! Did not think about that.
But how do i figure the matching name?
Everytime i create a new “Zettel” its name will be different.
You propose to always use the same prefixes for a general note?
Thanks for the helpful info - did not knew that.
Is there any other way within the boundaries of Keyboard Maestro to specifically select a newly created markdown document?
Ok, so instead of using the name as a defining feature for the smart rule, use the contents, which will always contain “Note/Resource ID:”, “Schlagwörter:”
An alternative (which I would use if I were using various methods to create such MD files, and they all triggered my smart rule although I didn’t want those from a different source to do so) would be to include a destination in your URL, so that the new file is created in a group (called “new MDs” or whatever) and then moved by the smart rule from there to the inbox and then opened. That would limit your smart rule to those MDs being created in that specific group, so you could use “kind is markdown” as your only criterium.