Help amending an action (script)

#1

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 …)?

#2

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
#3

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

#4

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

1 Like