Workflow to export only bold texts to evernote

Hi, I asked Drafts’ support and was advised to join this community for some help. I would like to do some progressive summarizing in Drafts and export bold texts to Evernote. I did some research in this community but I have not found any similar action template for this workflow.

Can someone help me do some trick to make exporting bold texts to evernote (or any other apps such as Notion) possible?

This will help Building a Second Brain people tremendously.

Thanks for your help in advance.

Kent

In concept you’d just want to do a short script that matches all text between whatever you are using as your bold markers (i.e. ** or __).

That should be pretty straight forward with just a couple lines of javascript, and would be a great introduction to javascript and regex for a beginner.

Hint: Try something like regex101.com to test out your pattern to make sure it’s matching what you want it to.

cpac,

My son helped me come up with the following scripts:


// See online documentation for examples
// https://docs.getdrafts.com/docs/actions/scripting

var re = /**(.*?)**/g;
var text = editor.getText();

var res = “”;
var m;
do {
match = re.exec(text);
if (match) {
var bolded = match[0];
bolded = bolded.replaceAll("**", “”);
res += bolded;
res += ‘\n\n’;
}
} while (match);

draft.setTemplateTag(“bolded”, res);


Just add it in Script step after preset Evernote step in Action settings.

Hope this will help other members of Drafts community.

Best
Kent