Drafts defines a single global
app object which provides access to application level functions.
Returns the active theme mode, light or dark, taking into account automatic switching of themes if active. If writing scripts to branch logic based on the current mode, this is the best property to use.
Returns a workspace object configured like the workspace currently loaded in the draft list of the active window. Useful when creating logic which reacts contextually to the workspace loaded.
Is the action list side panel is visible.
Is the draft list side panel is visible.
Is system sleep timer disabled preventing screen dimming/sleep.
Returns true if app has an active Drafts Pro subscription.
Get or set themeMode.
Version number of current installation of Drafts.
Apply the Workspace as if it was selected in draft list. Calling this function with no arguments will clear filters and apply the default workspace.
Show error banner notification with the message passed.
Show info banner notification with the message passed.
Show success banner notification with the message passed.
Show warning banner notification with the message passed.
Get current contents of the system clipboard.
Close action list side bar.
Close draft list side bar.
Takes HTML string and converts it to rich-text and places it in the system clipboard. Returns true if successful, false if an error occurred in conversion.
a possibly-valid html string
Load the ActionGroup in the action list side bar.
If able, open the requested draft in a new window. This method only functions on iPad and Mac. The ability to open new windows is not available on iPhone.
true if successful.
false if unable to open a new window (as on iPhone).
Request system opens the URL passed. Returns true if URL was opened, false if the URL was invalid or no available app can open the URL on the device.
url to open
whether to use the Safari View Controller (true) or default browser (false).
Open draft selection interface and wait for user to select a draft. Returns the select draft object, or
undefined if user cancelled.
If provided, the workspace will define the default filtering, display, and sort options for the selection window.
Set the contents of the system clipboard.
Enable and disable the iOS system sleep timer to prevent screen dimming/sleep.
Open action list side bar.
Open the "Get Info" view for a draft. If no draft is passed, the current active draft in the editor will be used.
Open draft list side bar.
Open quick search window, optionally providing a initial query value.
Generated using TypeDoc