The script editor

The Vertec Script Editor for creating and executing Python scripts

Product line

Standard

|

Expert

Operating mode

CLOUD ABO

|

ON-PREMISES

Modules

Services & CRM

Budget & Phases

Purchases

Resource Planning

Business Intelligence

Created: 08.08.2019
Machine translated
Updated: 19.08.2024 | Python Console moved from Scripts article to here

To run Python scripts directly, there is the Script Editor. You can open it via menu settings > Script Editor. The Script Editor is shown as a separate page in a new tab:

In the left part of the window, the code is shown or edited. It must be valid Python code.

The right part of the window is the output window (as a separate application there is the Python Console , which only displays the output window).

There are 4 buttons:

Execute: Execute the code displayed in the left part of the window.
Open File: This allows a script to be opened from the filesystem in the Script Editor. This button is not available in the web app.
Save file: Saves the code shown in the left part of the window to the corresponding file. If it is new code, a save dialog will appear. This button is not available in the web app.
The Vertec settings menu

The Script Editor uses the last selected Vertec object in one of the other tabs as argobject . The respective argobject is shown in the upper part of the Script Editor window.

Any number of Script Editor windows can be opened in parallel. They work independently of each other, but all display the last selected Vertec object as argobject.

The Script Editor can also be opened via the Script Editor button in a script entry. In this case it contains the script text of the corresponding script entry.

In addition to the usual shortcuts for copy (Ctrl+C) and paste (Ctrl+V), the following keyboard shortcuts are available:

  • Mark and Tab: Indent selected block
  • Select and Shift-Tab: Decrease the indentation of the selected block
  • Ctrl+E: Run script (from Vertec 6.3.0.8)
  • Ctrl+Z: Undo (from Vertec 6.3.0.8)

Single-line commands can also be entered directly in the output window of the Script Editor or in the Python Console , e.g. argobject, or for e in argobject.eintraege: print e.code, etc.

In the output window, the last input can be called by Ctrl + ↑ and re-executed directly. If Ctrl + ↑ is called several times, (all) previous inputs will be returned or the newer ones will be returned by Ctrl + ↓.

The Python console

An important part of the Script Editor is the ability to run a Python statement on the up-to-date object and see the result, i.e. the console functionality. To make this easier, Vertec 6.3 introduced a Python console, which is available to users with administrator rights.

You can show and hide the console from the settings menu and the keyboard shortcut F3:

The console is shown at the bottom of the Vertec window:

The height of the console can be changed with the mouse:

Right-clicking on the Python console brings up a context menu with the option to delete the console content.

The variable “argobject”

The argobject variable returns the up-to-date object (the up-to-date entry) in Vertec. This is the entry selected as the main entry in the active Vertec window, e.g.:

projekt = argobject