triggerAction()
The function can be used to trigger an action from a GEDI or Script Editor extension script.
Synopsis
int triggerAction(string actionName [, string moduleName]);
Parameters
Parameter | Description |
---|---|
actionName | Name of the action that is triggered. |
moduleName | The module which is targeted. |
Return value
-1 in case of an error and 0 in case of success.
Errors
The specified action was not found.
Description
This function can be used from a GEDI or Script Editor extension script and triggers an action. By default the "target" window is always the window in whose context the script is used (e.g. when used from a GEDI extension script, then the target is the GEDI window). The optional variable "moduleName" allows you to address windows outside of this (e.g. address a GEDI or Vision main window from a script in a panel in a runtime Vision module).
The list of actions that can be used can be found in the GEDI:
Example
Draw a line with triggerAction(), utilizing sendMouseEvent().
main()
{
triggerAction("line");
sendMouseEvent(panel, 50, 50, MOUSE_LEFT);
sendMouseEvent(panel, 350, 350, MOUSE_LEFT);
sendMouseEvent(panel, 350, 350);
}
User-defined actions added with moduleAddAction() via an extension script can now be called by their "name" property.
Assignment
gedi extension functions
Availability
CTRL