Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Action

module

Global

Action

In addition to being able to lookup an action using the find method, a single global action object is created and available in scripts to inquire about the current action and control flow.

Example

// find action
let action = Action.find("Copy");

// queue to action to run after the current action
app.queueAction(action, draft);

Hierarchy

  • Action

Index

Identification Properties

Query Methods

Identification Properties

Readonly installURL

installURL: string

URL which can be used to install this Action in another installation of Drafts. Useful for sharing and backups.

Readonly isSeparator

isSeparator: boolean

If true, the action is a separator.

Readonly name

name: string

The display name of the action as displayed in the action list.

Readonly uuid

uuid: string

The unique identifier of the action group.

Query Methods

Static find

  • find(name: string): Action | undefined
  • Search for action matching the name passed and return it if found. Useful to lookup and action and queue it to be run using app.queueAction(action, draft). This method will return only the first found action with the given name, be sure to avoid duplicate names in your action list.

    Parameters

    • name: string

      Name of a valid, installed action.

    Returns Action | undefined

Generated using TypeDoc