Drafts (Mac) action script for DevonAgent?

Has anyone created a Drafts action to perform a DevonAgent search?

I see DT3 actions, but nothing for DA.

What kind of automation/scripting does Drafts actually use? If AppleScript or JXA is supported, then this should be possible.

Drafts actions usually call URL schemes.

PS: x-devonthink://search?query=sync doesn’t work. Bug?

Works fine over here but the request is actually for DEVONagent.

Strange. It wasn’t working in Safari at all. It worked here in DT3 then it did in Safari. :thinking:
And yes, I know. Just noting it as a related example of something Drafts would use.

Drafts can invoke AppleScript. See https://scripting.getdrafts.com/classes/AppleScript

Probably only on Macs. But JavaScript works with Drafts on all platforms.

Looks like AS code in a JS wrapper :stuck_out_tongue:

DevonAgent is a Mac-only app, so that’s not an issue.

None of us in-house use Drafts but you can invoke a DEVONagent search in AppleScript via a simple command, e.g., …

tell application id "DNag" to search "disney piglet" using plugin “net.stateful.devonagent.duckduckgo.plugin"

You can get the plugin’s bundle ID in Window > Plugins & Scanners.

You can also use a search set, callit it by name, e.g., using set “Express”.

What is the syntax of the text string to pass to the “using set” clause, if it is hierarchically nested? (e.g., Search Sets→Web→Deeper vs. Search Sets→Web→Express)

Just as shown in my example.

Do the set “subsets” have to be unique, and that name directly references them?

Yes, the search set names should be unique.

If you build an action please can you share it? One of my winter projects will be figuring out DevonAgent and I’m already using Drafts so this seems handy.

Just closing the loop and cross referencing back to @jdowson’s post on the Drafts forum where I outlined an approach for this in detail.

It includes triggering the search rather than just populating it, some discussion of using services/quick actions to enable cross application use, and how you could have a trigger in Drafts to a centralised option if you wanted to use it in multiple places and have an action in Drafts

@MsLogica a standalone Drafts action is provided in the post.

I have also added a link back to this topic on the Drafts topic too so that people can view the entire discussion.

4 Likes

Welcome @sylumer
Thanks for chiming in and the link to the related discussion on the Drafts forums :slight_smile:

1 Like

Thank you :slight_smile: