PLUG'N SCRIPT
rapid plugin development
Tutorial
DSP
KUIML
How-to
Scripts
  • Tutorial
  • Element Reference
Language basics
  • SKIN
  • DUMMY
  • INCLUDE
  • INCLUDE_ONCE
  • DEFINE
  • UNDEFINE
  • VARIABLE
  • LOCAL_VARIABLE
  • TEMPLATE
  • TEMPLATE_INNER_CONTENT
  • REPEAT
Data model
  • PARAM
  • ACTION
    • Action types
  • ACTION_TRIGGER
UI Layout and positioning
  • CELL
  • TABLE
UI Widgets
  • TEXT
  • TEXT_FIELD
  • TEXT_EDIT_BOX
  • CANVAS
    • Graphics API
  • svg
Common attrubutes
  • For all elements
  • Widgets
  • Param Widgets
  • Param Controls
  • Param Info Viewers
  • Text Widgets
  • Surface Viewers
  • Curve Viewers
  • 3D Objects
  • Parameters mapping
KUIMLElement ReferenceACTION
November 29, 2022

ACTION

This element represents an action that can be triggered by the end user with an action button, or by other events, for example using the ACTION_TRIGGER element.

Attributes brief detailed show all inherited

Name Description
typeThe type of action to execute. See the available Action Types for more informationEach action type may use specific attributes.
nameDisplayed named of the action
commentComment about the action
Exposed: v. 1.9.1enabledactivation status of the actionIf disabled, the action will not execute
Common attributesRead about `common`
idIdentifier of the elementThe id of an element has to be globally unique. Two elements cannot have the same identifier
Name Value type Default Description Comment
typeaction typeemptyThe type of action to execute. See the available Action Types for more informationEach action type may use specific attributes.
namestringemptyDisplayed named of the action
commentstringemptyComment about the action
Exposed: v. 1.9.1enabledbooleanemptyactivation status of the actionIf disabled, the action will not execute
Common attributesRead about `common`
ididentifieremptyIdentifier of the elementThe id of an element has to be globally unique. Two elements cannot have the same identifier

Examples

The following action runs a script that increases the variable each time it is executed and updates a string.

  1. <!-- action that runs a script -->
  2. <ACTION id="run_my_script" name="Click me" type="Script"
  3. script=" 
  4. string s = &quot;Script executed &quot;;
  5. run_count++;
  6. out_string = s + run_count + &quot; times&quot;;
  7.  " requires="out_string;run_count" />

  8. <!-- add a script variable -->
  9. <SCRIPT script="int run_count = 0;" />

  10. <!-- string to output results -->
  11. <STRING id="out_string" default="" />
  12. <TEXT_FIELD width="300" string_id="out_string" />

  13. <!-- a simple button -->
  14. <SYSTEM_ACTION_BUTTON action_id="run_my_script" width="180" />

Different action types allow you to open file dialogs, open URLs in browser, open files with standalone apps (including running batch/bash/misc scripts with terminal or command line), open folder dialogs in Finder/Explorer, display message boxes, save and open data (objects) to files, copy and paste data to/from clipboard, and certainly run AngelScript code in the GUI.

Check out a full list of action types and examples.

Built-in actions

These actions can be used to make your own skin from scratch. 

  1. <!-- open main menu -->
  2. <SYSTEM_ACTION_BUTTON action_id="OpenMenu" width="180" />
  3. <!-- open presets menu -->
  4. <SYSTEM_ACTION_BUTTON action_id="OpenPresetsMenu" width="180" />
  5. <!-- open window with preset settings (midi mapping etc) -->
  6. <SYSTEM_ACTION_BUTTON action_id="OpenPresetSettings" width="180" />
  7. <!-- open window with global settings (midi mapping etc) -->
  8. <SYSTEM_ACTION_BUTTON action_id="OpenGlobalSettings" width="180" />
  9. <!-- open 'About' dialogue -->
  10. <SYSTEM_ACTION_BUTTON action_id="DisplayAbout" width="180" />
  11. <!-- open manual (if exists) -->
  12. <SYSTEM_ACTION_BUTTON action_id="OpenManual" width="180" />
  13. <!-- Undo and Redo -->
  14. <SYSTEM_ACTION_BUTTON action_id="Undo" width="180" />
  15. <SYSTEM_ACTION_BUTTON action_id="Redo" width="180" />
  16. <!-- open "Load preset" window -->
  17. <SYSTEM_ACTION_BUTTON action_id="LoadPreset" width="180" />
  18. <!-- open "Save preset as" window -->
  19. <SYSTEM_ACTION_BUTTON action_id="SavePreset" width="180" />
  20. <!-- saves current state as "User default" (without confirmation) -->
  21. <SYSTEM_ACTION_BUTTON action_id="SaveAsDefaultPreset" width="180" />
  22. <!-- switches no Next or Previous preset -->
  23. <SYSTEM_ACTION_BUTTON action_id="NextPreset" width="180" />
  24. <SYSTEM_ACTION_BUTTON action_id="PreviousPreset" width="180" />
  25. <!-- shows the popup-menu for the input or output parameter (midi learn/control setup etc) -->
  26. <SYSTEM_ACTION_BUTTON action_id="Show_dsp.input0_ControlSetup" width="180" />
  27. <SYSTEM_ACTION_BUTTON action_id="Show_dsp.output0_ControlSetup" width="180" />

Built-in action types

These action types can help you create various actions:

  1. <!-- run a script -->
  2. <ACTION id="my_action" type="Script" script="..." />

  3. <!-- copy object to/from clipboard or file -->
  4. <ACTION id="my_action" type="CopyObject" object_id="..." ... />
  5. <ACTION id="my_action" type="PasteObject" object_id="..." ... />
  6. <ACTION id="my_action" type="LoadObject" object_id="..." ... />
  7. <ACTION id="my_action" type="SaveObject" object_id="..." ... />

  8. <!-- open file and folder dialogs -->
  9. <ACTION id="my_action" type="OpenDirectory" url="..." ... />
  10. <ACTION id="my_action" type="DisplayFileOpenDialog" ... />
  11. <ACTION id="my_action" type="DisplayFileSaveDialog" ... />
  12. <ACTION id="my_action" type="DisplayFolderSelectDialog" ... />

  13. <!-- open url or a file, run an app -->
  14. <ACTION id="my_action" type="OpenUrl" url="..." ... />

  15. <!-- display message box -->
  16. <ACTION id="my_action" type="DisplayMessageBox" message="..." ... />

  17. <!-- related to making a custom skin -->
  18. <ACTION id="my_action" type="DisplayPlugNScriptMenu" ... />
  19. <ACTION id="my_action" type="ExportPlugNScriptPlugin" ... />
  20. <ACTION id="my_action" type="GeneratePlugNScriptGUID" ... />

Check out the page about Action types with examples.


Comments

2020 © Plug'n Script and KUIML by Blue Cat Audio  |  Site by LetiMix