Private
constructorReadonly
isUse app.currentWindow.isActionListVisible
Readonly
isUse app.currentWindow.isDraftListVisible
Returns a window object configured representing the active window.
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.
Readonly
areCheck if Live Activities are supported on the current device/platform.
Is system sleep timer disabled preventing screen dimming/sleep.
Readonly
isReturns true if app has an active Drafts Pro subscription.
Readonly
versionVersion number of current installation of Drafts.
Readonly
currentReturns 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.
The current dark mode theme.
The current light mode theme.
Get or set themeMode.
Get current contents of the system clipboard.
Optional
clipboardType: clipboardTypeOptionally specify a data type to fetch from the clipboard. Default: "string"
Set the contents of the system clipboard.
the data to set in the clipboard. If a string
is passed it is set in the clipboard. Optionally an object with clipboardType keys and string values can be passed to set multiple data types in the clipboard.
replaced by loadActionBarGroup
.
Use app.currentWindow.showDraftInfo
Optional
draft: DraftApply the Workspace as if it was selected in draft list. Calling this function with no arguments will clear filters and apply the default workspace.
Optional
workspace: WorkspaceLoad the ActionGroup in the action bar below editor.
Load the ActionGroup in the action list side bar.
Open draft selection interface and wait for user to select a draft. Returns the select draft object, or undefined
if user cancelled.
Optional
workspace: WorkspaceIf provided, the workspace will define the default filtering, display, and sort options for the selection window.
Start a Live Activity for the selected Draft. Returns true if Live Activity started successfully. Returns false if Live Activity could not be started, or Live Activities are not supported on the device.
The draft to use in the Live Activity
Stop a Live Activity for the selected Draft. Returns true if Live Activity stopped successfully.
The draft to use in the Live Activity
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
Optional
useSafari: booleanwhether to use the Safari View Controller (true) or default browser (false).
Generated using TypeDoc
Drafts defines a single global
app
object which provides access to application level functions.Example