If I define a Smart Rule with the trigger “On Clipping”, it works as desired when I use the “Clip to DEVONthink” extension for Safari or the Sorter (e.g., via the menu extra). However, it also gets triggered when I do other actions within DEVONthink. For example, when I select a bookmark in a DEVONthink group and use actions from the Capture menu such as convert to PDF.
How can I get an action to trigger only when something is sent to DEVONthink using the browser extension?
Here is what my test rule looks like:
You can’t. Capture in DEVONthink is also a clipping function.
Development would have to assess the request.
OK, hopefully decoupling those things will be considered for a future software update.
Some people may be interested in your bookmarklet’s code, if you feel like posting it.
The approach relies on a combination of mechanisms:
- A Smart Rule in DEVONthink that is triggered when a new web page bookmark is created if the bookmark contains a certain tag. In my use, this Smart Rule then runs an AppleScript program, but obviously it could do other things.
- A custom bookmarklet that can be used from Safari that, when invoked, sends a URL to DEVONthink with the required tag.
Here is the bookmarklet code:
And here is a screenshot showing the Smart Rule configuration:
If one wanted to change the name of the tag, it would need to be changed in the bookmarklet (it’s at the very end of the bookmarklet code, following
tags=) and also in the Smart Rule.
Some further explanation may be warranged about what the Smart Rule does. This particular Smart Rule is something I use to create PDFs from web pages in a way that tries to delay with possible dynamically-generated content in the page. (C.f. this discussion.) Note that the rule removes the tag before creating the PDF, because the PDF file will inherit any tags on the bookmark when DEVONthink creates it, and you don’t want the tag to be put on the resulting PDF file. The rule also moves the original bookmark to the trash because for my purposes, it’s no longer needed after the PDF conversion is done.
FWIW, I put everything up in a GitHub repo.