DEVONthink To Go allows you to execute certain actions by opening links, URLs, that begin with ‘x-devonthink:’ or ‘x-devonthinktogo:’ instead of, e.g., the well-known ‘http:’. You can add these links to other apps, e.g., OmniFocus, or even paste or type them into the address bar of Safari. Instead of opening a web page they activate DEVONthink To Go and make it do something.
For Workflow.app and other automation tools, DEVONthink To Go supports the x-callback-url protocol. Many commands listed below can be used either directly or as x-callback-url command.
The URL commands for DEVONthink To Go look like follows:
All parameter values have to be percent-encoded. If you are manually building URL commands, you can use online tools like urlencode.org to encode the values.
clip: Opens the New Document Assistant, pre-filled with the provided data.
createbookmark: Creates a new bookmark.
createdocument: Creates a new document from UTI and file data.
creategroup: Creates a new group.
createhtml: Creates a new HTML document.
createimage: Creates a new image.
createmarkdown: Creates a new Markdown document.
createtext: Creates a new plain text document.
createwebarchive: Creates a new webarchive.
import-clipboard: Imports data from the pasteboard to the global inbox.
Depending on the command you have to provide additional data via parameters:
destination: The UUID of a group or database where the item shall be created.
title: The title of the item to be created.
comment: A comment to be added to the item.
location: The URL linking to the content, e.g., the URL of the website for the bookmark or the image.
source: Base64-encoded file data for createimage and createdocument, raw HTML data for createhtml.
text: The text content for text documents.
uti: The UTI for the document (only used for and required by createdocument).
Note: If the ‘destination’ parameter is not specified the item is created in the global inbox. You can find the UUID of a group by getting its item link and cutting the UUID out of the URL (the long alphanumeric string after ‘x-devonthink-item://’).
You can retrieve metadata about a document or even the document content (up to 10 MB in size) using the following two commands. As they deliver raw data they only work when called with the x-callback-url protocol variant.
item: Retrieves selected metadata of a document as JSON object.
content: Retrieves the content of a document as base64-encoded data.
Both commands take one parameter:
uuid: The UUID of the document, e.g., derived from an item link (see above).
The data is sent back in the following parameters of the x-success URL:
text: The base64-encoded document data or the metadata as JSON object.
input: ‘text’ (for Workflow.app).
uti: The UTI of the document (‘content’ command only).
Search your databases.
search: Search DEVONthink To Go and show or retrieve the results.
The command takes the following parameters:
query: The query to use for the search.
scope: The UUID of the database or group to search. Optional; if not set DEVONthink To Go searches all databases.
When called in the regular form the command navigates to either the database or group given as scope or to the global inbox. It then shows the search field, sets the scope button, and enters your query.
When called in the x-callback-url form DEVONthink To Go executes the search and sends the results back:
text: The results as JSON array of objects.
input: ‘text’ (for Workflow.app).