Insert Text From Other Drafts

Hi everyone,
Is it possible to insert text from another draft through an action?
My use case: I keep various templates in one workspace within Drafts (meeting note, literature note, etc…) and would like to have actions to retrieve the content of a specific template and insert it into the current draft.
Is this possible?
I know, Drafts has a template system to retrieve template files from within the Finder/Files App but I would like to use Drafts itself as a repo for my templates because that way I can easily call them from the Shortcuts App to use in other automations as well.

Thanks for any suggestions!!

The action does this.

But you can build on the principle to constrain it to only drafts that match your template draft criteria.

1 Like

Hello. I am new here and just learning. I found this thread when looking for something similar.

Is there a way to combine the “Insert Draft” action referred to above with the menu selection of the “New Draft with Template” action?

My use case:

I have a number of unique client reference numbers I would like to insert into a draft, but which reference number I want to input changes.

Currently I have all the reference numbers in a single draft in this format:

———

Client Ref 1 - 12345.6789
Client Ref 2 - 23456.7890

———

My current thought is that I need to:

  1. Put each client ref number into a separate draft
  2. Tag each of those drafts with a tag (e.g. “Client Ref”)
  3. Create an action using the “New draft with Template” functionality to list out the drafts with the tag “Client Ref”
  4. Find a way to add the content of the selected draft where the cursor is, instead of creating a new draft from the selection, which is what the “New draft with Template” function does currently.

Questions:

  1. Is my approach above the best way to do this? Is there a better way?
  2. Is anyone able to give me some guidance as to how to do it? If there are any basic JavaScript courses (preferably free) that I need to review to be able to help myself, I’d love recommendations. I have a problem solving mind, so not knowing what to do is extremely frustrating. That said, I’m also in an ADHD mess right now, so if this is straightforward and someone is feeling charitable, I’d love some help with the specific action.

Thanks for reading this

Alex

Are you inserting the full content of the draft? Autocomplete has built-in support for inserting other drafts. Just type << and you’ll get a drop-down. Keep typing to filter list, select one, and it’s contents will be inserted at the cursor.

Yes. Just populate and filter the drafts.

How many do you have roughly? The volume might well help determine options.

It is a way, but you could use a dedicated action without drafts as the source, TextExpander (if you have it), or maybe even auto completion.

Search the forum. Eloquent JavaScript comes up a lot previously as a good start - but it may jot be necessary for your case.


For new queries, do try and post a new topic. You can always link back to other topics for reference.

Thank you. I mis-read the guidance for new members and didn’t think I could post a new topic.

I have approximately 20 client reference numbers active at any one time.

I will look into the two other options you referenced, as that may be a much better way to handle the issue, I’ll also search regarding JavaScript. Thank you for replying so promptly!

As an update, the auto complete functionality worked great!

I now have another query, but I will start a new topic.