Drafts --> NotePlan demonstrating external file variables

I made an action for sending text in drafts to specific notes in NotePlan. It presents a menu populated by an external file. You can also create a new note in NotePlan with this action, which updates that external file. This means that the action will always have the most recent list of NotePlan notes in the menu, without you having to manually edit the prompt.

https://actions.getdrafts.com/a/13D

Reads list of NotePlan file names from a file, then sends draft text to that note via prepending. Or, allows you to name a new file which is created in NotePlan with the draft text added. New note name is then saved to Project list file and read into the menu when you next run the action. This way you can add new notes without having to manually update the prompt.

To get started with this action:

  1. Run the Drafts action for the first time and type “Testing” (or whatever your want) into the text box. This will create a file called “noteplan-projects.json” in your Drafts iCloud Drive folder. You can edit the script on lines 4 & 32 to change the name or location of this file (so long as it resides within the Drafts iCloud Drive folder–you can’t move it from there). It will also create a new note in your NotePlan app called “Testing”, which you can delete. (sometimes there seems to be a bug on Mac at least where if NotePlan isn’t open when you run the action, the x-callback command is ignored)
  2. Open the “note plan-projects.json” file in a plain text editor (like VS Code, Bbedit, whatever). It should have this content:
    [“Testing”]
  3. Edit that file to include the names of your other notes. Enclose each name in quotes and add a comma between them. Like so:
    [“Home”,“Work”,“Hobbies”,“Movies”]
  4. Save the file and close the text editor
  5. Now, when you run the Drafts action, you should see those note names show up as options you can choose in a menu. When you choose one, it sends the text of the current draft to that note by prepending.
2 Likes