I have a problem when using the action “Send to Devonthink” from Drafts into Devonthink. I can’t see the note enter my global inbox in DT, even if I hear a confirmation sound in Drafts that the script has run.
I’m using the official Drafts action for Devonthink integration:
Maybe somebody can tell if the script looks ok: x-devonthink://createText?title=[[title]]&location=''&text=[[body]]
Have a look in the DT documentation (type “callback” in the Help menu’s text box and select “URL Commands”.
There doesn’t seem to be a command createText. So maybe you should talk to the Drafts people?
Opened URL: x-devonthink://createText?title=Lothar%20Ledderose%3A&location=''&text=China%20Schreibt%20Anders%2C%0AAlfred%20Kr%C3%B6ner%20Verlag%2C%0AStuttgart%202021.%0A116%20Seiten%2C%2019%2C90%20Euro.%0A
Why are you using the location parameter here? That’s the URL of the document, e.g., www.devontechnologies.com. If you’re trying to put the document somewhere specific, you should be using the destination parameter and the destination’s UUID.
The original question was about the Drafts action, which is as it is, ie with an empty location. It works ok here, and the interesting question is why it doesn’t for the OP.
Guess what. After I included a title in Drafts, and made a break, then wrote some more text, then it worked. Hmm…
So it seems that the script strips of the first line for title and is dependant on content under the first line to create content (or at least a break) and ultimately place it in Devonthink. Well that solved the mystery.
I also came here troubleshooting silent failure of the action. I’m surprised that DT’s processing of the callback URL will fail if the body is blank (&text=[[body]]). Isn’t an empty text file a valid one?
I changed it to x-devonthink://createText?title=[[title]]&location=''&text=[[draft]] which saves the entire draft as the text. If it’s just a one-line draft, the send to DT will still succeed. I like to have a title line at the top of a text document anyway.
The URL handlers on the Mac are actually only intended for bookmarklets & browser extensions but not for automation. AppleScript or JXA are usually recommended instead.