Python scripts using the Scripting API and the Pulsonix Python client can be run like any other Python script. The Run Script (Legacy) command is not related to the Scripting API.

Scripts using the Python client will raise errors if your system is not correctly configured or Pulsonix is not hosting a scripting server.

Only folders containing Legacy scripts should be added to Scripts in the Folders dialog. Folders for scripts using the Pulsonix Python client should not be added.

Using Command Prompt

Windows Command Prompt is a reliable way to run a Python script. The exact command needed depends on your system configuration:

  • For any installation: Locate where the python.exe interpreter is on your system and use it on the command line to run your script: C:\Path\To\python.exe C:\Path\To\My\script.py.
  • If the launcher is installed (default): Use py C:\Path\To\My\script.py to use the latest installed Python version, or py -x.y C:\Path\To\My\script.py to run with version x.y.
  • If Python is on the PATH: Use python C:\Path\To\My\script.py to use whichever version of Python is found on the PATH first.

Using File Explorer

Python scripts can be run by being opened using the Windows File Explorer. If Python is not the application associated with .py files, they can still be run via Open With > Python from the context menu for the file.

Running scripts as User Tools

Specific scripts can be defined as User Tools in Customise - Tools. The fields on the dialog should be filled as follows:

  • Command: py if the Python launcher is installed and available on the PATH, python if a Python executable is available on the PATH or the full path to a python executable.
  • Arguments: The path to the script to be run, as well as any other arguments to pass to the script itself.
  • Initial Directory (optional): The path of the folder to run the script in - this will become the working directory of the script.
  • Run Script: This combo box is for Legacy scripts only and should be left empty.

Running scripts using Shortcut Keys

Once defined as a User Tool, the script can be assigned to a shortcut key in the normal way using the Keyboard tab in the Customise dialog and selecting User Tools from the Category drop-down list.

Running scripts without Pulsonix open

Scripts can be run without the Pulsonix application being visible, but Pulsonix must still be running. More information is available here.

Running a script in another language

Scripts in other languages is not directly supported by Pulsonix, but other languages can communicate with the Scripting API - the method for running scripts in other languages will depend on the client implementation used.

Scripting Overview | API Interaction | Python API client