Can this script be improved?

Hi,

I’m not much of coder… and was wondering if someone could assist?

This wonderful Action from @nahumck Process Meeting Notes looks for any line with “- [ ]” in a Draft and sends it to Things as the title of the Task (my use.)

However, the power of the script is lost in that the “- [ ]” is carried over into the start of the title in Things… forcing the user to delete that part.

Minimizing the additional interaction with the title makes the Action much more valuable.

The question: How can the script be improved by removing the “- [ ]” before the title of sent to Things?

  • I know there is a line of code that can do this…

Many thanks to all,
Jason

Just a quick look, but it seems like a bug in just the “Things” branch of the script. In the Todoist-related script has this line:

var task = line.replace("- [ ]","");

Which does exactly what you are asking, removes the “- [ ]”.

The third script step, related to Things, has this line in the same place:

var title = line.replace("⇢","");

Replace that line in the third script, with the one from the second above, and it should work.

1 Like

This was the direction I needed…

When Copying the ToDoist version, you must also change “task” to “title” - so the new third line of the Things script should look like this:

var title = line.replace("- [ ]","");

Works brilliantly now, thanks so much, Greg!

1 Like

If only that person who created the script was a coder and knew what they were doing… :smirk:

1 Like