Skip to main content

performAction

See Action API. Executes a series of action functions provided as arguments.

performAction(actionFunction, actionFunction, ...)

Parameters#

  • actionFunction: Functions that compose an action. These functions don't do anything on their own besides returning a map containing just one entry, having their name as key and arguments as list. That's why these functions has to be used only as arguments to performAction. Following lists all action functions:

    • focus(elemId): Focuses on the given element.
    • shiftDown(): Depresses the shift key.
    • shiftUp(): Releases the shift key.
    • ctrlDown(): Depresses the ctrl key.
    • ctrlUp(): Releases the ctrl key.
    • cmdDown(): Depresses the cmd key.
    • cmdUp(): Releases the cmd key.
    • cmdCtrlDown(): Special function that work across platforms. If a part of your app use cmd in Mac but ctrl in Windows, you can use this function. It will detect current platform and depress one of the key.
    • cmdCtrlUp(): Similar to it's counterpart cmdCtrlDown and releases one of the key depending on current platform.
    • altDown(): Depresses the alt key.
    • altUp(): Releases the alt key.
    • sendKeys(keys, keys, ...): Sends the given keys to currently focused element. Don't use it for sending modifier keys, use dedicated functions such as shiftDown().
    • move(elemId): Moves pointer to the center of given element.
    • move(elemId, x, y): Moves pointer to an offset of x, y from the center of given element.
      • x: A number. Offset in x axis in pixels, can be negative.
      • y: A number. Offset in y axis in pixels, can be negative.
    • move(x, y): Moves pointer to an offset of x, y from it's current position.
      • x: A number. Offset in x axis in pixels, can be negative.
      • y: A number. Offset in y axis in pixels, can be negative.
    • hold(): Holds the pointing device on current element (such as depressing left button of a desktop mouse).
    • releases(): Releases the pointing device (such as releasing left button of a desktop mouse).
    • clickOnce(): Clicks on current element. Note the Once suffix used to distinguish it from click.
    • doubleClick(): Clicks on current element twice.
    • contextClick(): Right clicks on current element.
    • pause(milliseconds): Pauses execution for the given amount of time in milliseconds.

Returns#

  • No value