Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Feature Description

Canvas Script Editor is an interface for users to create, control, and modify specific portions of the project's workflow. The Script Editor also has debugging support, giving the user an error whenever the script is called to run in runtime. The Script Editor uses JavaScript ES5 for its syntax and language, though it has commands unique to Canvas.

Table of Contents
maxLevel4
minLevel1
include
outlinefalse
indent
excludeFeature Description
typelist
printabletrue
class

Info

Canvas Script Editor uses JavaScript ES5. Only Features from ES5 or before are available to be used. Please refer to ECMAScript Documentation for complete specifications on the language. Features related to Document Object Model (DOM) are not supported in Canvas Script Editor.

Info

Canvas can only run 100 scripts concurrently. If any more scripts attempt execution while 100 scripts are running, the script will not execute, and a warning notification will be shown during runtime.

Designer Functionalities

Script Editor

To open the Script Editor, go to Tools > Script Editor, or on the Toolbar, click on Open Script Editor… to open it. The screen will then show all created scripts and what the content of each one is. Users can edit, delete, add, import, or export scripts within the Script Editor.

Creating a Script

To create a script, hit the + in the Script Editor. This will open a dropdown menu with the Create New Script or Create New Command option. Both will open up their respective setup pages when selecting either one. Create New Script will open a new page asking for the Scriptscript's name, the Running Type, and the Running Period. There are three running types: Periodic, Startup, and Manual. Once the configuration is set up, clicking OK will close the window and create a new script with the specified format.

Editing a Script

To edit a script, double-left-click on the script. This will open up a panel on the right side of the Script Editor screen. This displays all of the functionality of a script. Users can make changes to the script on this screen. Changes are automatically saved as the user makes the edits. Users can also compile any script by clicking the Validate icon. This will confirm that the syntax is correct and can compile properly.

Find and Replace

Find and Replace allows the user to search for specific parts of code within the script editor , and can allow for mass replacement of specific code if needed. Users can be more specific in searches by specifying the case, only by searching for words that are the same words, or by using Regular Expressions in the search.

Script Usage

Scripts can be called upon in a few different ways. The first way that they can be called on is by Startup. If the script is set to be a Startup script, it will execute when the program runtime begins. Periodic is another way to call a script. Periodic will call the script at a set interval of time that is user-defined within the Script Properties; the range for this interval time is 0 - 2147483647 ms. The final way to call a script is through Manual calls. These can be done where an object can have an action and call the script or command to call this script. An example would be a momentary button; this object has an Action tab, and the script can be called in any specified cause of Press, Double Click, or Release.