Drafts Script Reference

Draft

The Draft object represents a single draft. When an action is run, the current draft is available as the global variable “draft”. Scripts can also create new drafts, access and set values, and update the draft to persist changes.

Instance Properties

Instance Functions

Class Functions

Examples

// create a new draft, assign content and save it
let d = Draft.create();
d.content = "My new draft";
d.update();

// query a list of drafts in the inbox with the tag "blue"
let drafts = Draft.query("", "inbox", ["blue"])