Execute Script

This action enhances the software functionality by using custom VBScript or Python scripts. Use this function if the built-in actions don't meet your data manipulation requirements.

Scripts can include the trigger variables – both internal variables and the variables defined or imported from labels.

Make sure that Windows account under which the service runs has the privileges to execute the commands in the script.

UUID-e36abc17-1182-c0fa-0701-0e264b68bed8.png
[Note] Note

The script type is configured per trigger in the trigger properties. All Execute Script actions within a single trigger must be of the same type.

Script editor offers the following features:

  • Insert data source: inserts an existing or newly created variable into the script.

  • Verify: validates the entered script syntax.

  • Script editor: opens the editor which makes scripting easier and more efficient.

Script Editor

Loftware provides a script editor which makes your Python or VBScript scripting easier, error-free and time efficient.

UUID-ce54344b-81fa-b9a0-d94e-b1301e6bc27a.png

The selection of scripting languages that should be used in Script editor differs between Loftware Designer Pro and Automation Builder:

  • In Designer, double-click on the form design surface to open Form Properties >Additional Settings > Form Scripting Language.

  • In Automation Builder, go to Configuration items > click Edit to open trigger properties >Settings > Other > Scripting.

Loftware uses .NET variant of Python named IronPython. It works as a fully compatible implementation of Python scripting language which also supports .NET methods.

Editor Ribbon includes commonly used commands which are distributed over multiple functional groups.

  • Clipboard group offers Cut, Copy, Paste and Delete commands.

  • Undo Redo group allows undoing or repeating script editing actions.

  • File group allows loading and saving scripts in a file.

    • Load from file: loads a script from an external previously saved textual file.

    • Save to file: stores the currently edited script in a textual file.

  • Editing group allows finding and replacing strings in a script.

    • Find: locates the entered string in the script.

    • Replace: replaces string in the script.

  • Insert group: Data Source command inserts existing or newly defined data sources into the script.

  • Script group: Validate script command validates of the entered script's syntax.

Available scripting elements contain all available script items which can be used when building a script. Double-click the element or click the Insert button to insert the element at cursor position into the script.

Element description provides basic information about the inserted script element.

Error list includes the errors which are reported after the Validate script command is run.