Script Actions

From Memento Database Wiki
Jump to navigation Jump to search
« Page as of 2017-02-25, editions Mobile 4.3.0, Desktop 1.1.0 »

To initiate a script action, use the toolbar button on the libraries list screen or the toolbar on the entry edit card.

A script action is a specialized trigger which is initiated by the pressing of a button and executed in the background mode. Functions and objects that are available for triggers are available for script actions. Script actions use the same security parameters as trigger scripts.

Creating a script action

Each library can have multiple script actions. To see a script of a specific library, open Library > Menu > Scripts. To create a script action:

  1. Open the list of scripts, click the +, and select Actions.
  2. Select the place of script (context); it can be library or entry.
    Adding a script action on the toolbar of the library or entry card will make the button appear.

Arguments (parameters)

The script can have arguments, the values of which will be entered by the user.

To create arguments:

  1. Open the script edit card, move to tab arguments, and click +.
  2. To get the values of the arguments, use function arg(argumetn name). The type of the result depends on the type of the arument, and is similar to the field() function for an entry.

Functions and objects available for the script

Script actions can use the same objects and functions as trigger scripts. If the script is in the Entry context, then it can use function entry() to get the current entry.