Editing JavaScript

Similar to @sylumer, I do most of my script development outside of Drafts, and I try as much as possible to do it entirely on my Mac. If I’m doing it on my i*OS device, then will put the script in the body of a draft and use an action to execute that body.

For me, I leverage the FileBookmark feature agiletortoise enabled a few releases ago to point to my local git repo. The script is as such:

let bookmark = Bookmark.findOrCreate("git");
let fm = FileManager.createForBookmark(bookmark);

let content = fm.readString("src/ptdrafts.js");
this.eval(content);

If you include the Drafts definitions, you can use a decent editor or IDE to help with autocompletion. You can see how to do this at the GitHub page.