Help amending an action (script)

I like this action for sending a task to Things 3 - https://actions.getdrafts.com/a/1HS. What I am missing is adding a link back to the draft. I couldnt figure a way how to amend the script to automatically add the link into the note section of the task. Could somebody please help me with that (I am completely new to Drafts …)?

This is the line in the script which creates the β€œnote” value which is sent to Things:

const notes = (prompt.fieldValues.notes || '').trim();

That could be altered to the following to append the link to the current draft at the end of the notes:

let notes = (prompt.fieldValues.notes || '').trim();
notes = notes + "\n" + draft.permalink;

A couple of minor notes:

2 Likes

Thanks :slight_smile: Had to add the β€œs” to notes = notes + β€œ\n” + draft.permalink; and it works :slight_smile:

Oops. Coding without a net. :slight_smile: Fixed.

1 Like