Editing JavaScript

What tools are people using to create and edit Actions, i.e., write and edit JavaScript in Drafts?

I’m going crazy doing it within Drafts on my iPhone.

(Sorry if this question should have been posted in a different portion of the Community. :pleading_face:)

1 Like

Here’s what I do.

1 Like

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.