SynthEyes’s Python Script Handling

< Previous | | Manuals Home | Boris FX | Next >

SynthEyes’s Python Script Handling

SynthEyes allows Python scripts to be started from the Scripts menu, equivalently to SynthEyes Sizzle scripts. The .py files must be in the SynthEyes system or user script folders. (Note that the system script folder location can be set via the preferences.)

The first line of the Python script is read to extract a tool name, which is the contents of the line following the first semicolon. If there is no semicolon, then the filename is used as the script's title.

When SynthEyes starts the Python script, it supplies port and pin information to Python on the command line, as described above. The Python script being started can do an OpenExisting() call with no arguments to reach back into the calling SynthEyes instance. This makes the Python scripts straightforward. Here's the start of a tool that appears on the Script menu as "Scramble Trackers" (as usual, use SyPy3 here for python3)

# ; Scramble Trackers import SyPy

hlev = SyPy.SyLevel() hlev.OpenExisting()

# ... use the SyPy interface to do whatever you like ...

SynthEyes does not wait for the Python script to complete; the script may launch long-lasting user-interface windows, etc. Scripts should lock SynthEyes, using SyPy, to protect against simultaneous user interactions during operations that should be atomic.


©2023 Boris FX, Inc. — UNOFFICIAL — Converted from original PDF.