Drafts 21 has been released:
Details below. For a complete history of updates, visit:
Details below. For a complete history of updates, visit:
Drafts.send(key, value): Send data out to the action context. These values will be available to subsequent scripts using the context.previewValues object. So, if you call Drafts.send("mydata", {"a": 1, "b": true}) in your preview, you can later retrieve those values in a script step using context.previewValues["mydata"].Drafts.continue() and Drafts.cancel(): Equivalent to pressing the continue/cancel buttons in the preview UI. Allows automatic continuation of script with a form submission, for example, in the HTML document.app.currentWorkspace property returns a Workspace object configured as the current drafts list is configured. Note this is not the same as a named workspace object, even if you have recently applied a workspace to the list. Calling update() on this retrieved copy will create a new workspace. It is recommended this be used primarily as a read-only version of the workspace to use to pass to another function, such as app.selectDraft(). Docs
app.isPro boolean to determine if the app is pro unlocked. Docs
app.selectDraft() can now optionally take a workspace parameter to set the initial search/filtering in the select window. Docs
draft.append(text, separator) and draft.prepend(text, separator) convenience functions on draft object. separator is optional and defaults to a line feed. Docs
FileManager script object. The writeString and writeJSON methods no longer replace files, just update contents so the creation date is maintained and it interferes less with other apps using the same folders.app.selectDraft()).editor.setSelectedRange could inadvertently scroll to the end of the draft.Edit > Undo in main menu, or use Command-Z the keyboard.Drafts.send(key, value): Send data out to the action context. These values will be available to subsequent scripts using the context.previewValues object. So, if you call Drafts.send("mydata", {"a": 1, "b": true}) in your preview, you can later retrieve those values in a script step using context.previewValues["mydata"].Drafts.continue() and Drafts.cancel(): Equivalent to pressing the continue/cancel buttons in the preview UI. Allows automatic continuation of script with a form submission, for example, in the HTML document.app.currentWorkspace property returns a Workspace object configured as the current drafts list is configured. Note this is not the same as a named workspace object, even if you have recently applied a workspace to the list. Calling update() on this retrieved copy will create a new workspace. It is recommended this be used primarily as a read-only version of the workspace to use to pass to another function, such as app.selectDraft(). Docs
app.isPro boolean to determine if the app is pro unlocked. Docs
app.selectDraft() can now optionally take a workspace parameter to set the initial search/filtering in the select window. Docs
draft.append(text, separator) and draft.prepend(text, separator) convenience functions on draft object. separator is optional and defaults to a line feed. Docs
FileManager script object. The writeString and writeJSON methods no longer replace files, just update contents so the creation date is maintained and it interferes less with other apps using the same folders.app.currentThemeMode not always correct.app.selectDraft()).