Todoist Script help

I am using @davenicholls outstanding Todoist v3 script. I want to take it one step further. I would like to take a draft with a List and import into Todoist. To do this I would like to take the draft that has the List, convert the List from “# Test” to “#Test” and then run the Todoist script. Problem is my Java script skills are weak and I don’t understand how to do this. I appreciate all the help@

I think this would be all you need.

draft.content = draft.content.replace("# Test", "#Test");
draft.update();

Hi,

I’m not quite sure what you’re asking.

Are you saying that instead of using:

#Test

To set a default project, you want to be able to use a header. i.e:

# Test

but still have it picked up properly?

If so, if you look in the script you’ll find a line:

`var proj = line.match(/^#(\S+)\s*/m);a

I haven’t tested it, but I think if you add a space as follows it will do what you want:

var proj = line.match(/^# (\S+)\s*/m);

If you change it to:

var proj = line.match(/^# ?(\S+)\s*/m);

It should match either format.

Dave

Perfect! Thanks ! Now I can create lists and send them to Todoist