Batch Script Menu

The menu contains four main entries that will help make scripting tasks easier and provide access to often-used functions or settings. Although some of the functions share the same names as their counterparts in RealFlow's main interface, they work completely differently and cannot be executed with the commonly known shortcuts, e.g. the “Save” command.

 

File

This menu provides everything you need for organizing your scripts in terms of opening and saving. RealFlow batch scripts wear the extension RFS ("RealFlow Script") or PY ("Python").

 

 

New

Everything that is visible on the editor’s canvas will be cleared and you can start again with a fresh script. If your script has not been saved yet, RealFlow will suggest to save it first.

Save

To save the script to disk, please use this function.

Open...

You can easily load and open scripts with the file picker. When RealFlow opens a script, it does not check if the content is plausible or even contains a Python script, because that is up to you. As long as the file content is readable for RealFlow, it can be loaded in the editor.

Save As...

Especially with scripts it is often required to store intermediate versions or tests. It is also a good idea to make backup copies of your scripts. Batch scripts must always be stored before you decide to close a project, because they are not saved with a scene and must be saved externally. Once you have close the Batch script window, the program is lost. The usage should be familiar: just assign a new name to each version and store it with “Save As...”.

Scripting Preferences...

With this entry you can directly go to the appropriate section of RealFlow’s "Preferences" and adjust things like colours or fonts. There is a detailed description of the various functions with RealFlow's scripting editors.

Edit

Edit” provides everything you need for a fast workflow while writing scripts. Nevertheless you should be a little careful when pasting scripts from other sources, because of indents and leading spaces. You can also see powerful functions for finding and replacing words or phrases here.

 

 

Undo/Redo

Both actions exactly work as usual.

Cut/Copy/Paste

These three commands are available with all programs and operating systems, and should not need further explanation.

Delete

To use this function it is necessary to mark a section of a script first. Once you have selected the appropriate paragraph, you can remove it with “Delete”.

Select All

If you want to mark the entire script without exception, then please use this function.

Find...

This is actually a “find-and-replace” function. Calling “Find...” opens a new window with several options to search for certain word or phrases and you can replace them with a single click, as you can see from the image below:

 

 

Find next

You can look for the next appearance of a word without having to open and use the “Find...” option again.

Replace

A marked section in your script can be replaced with a certain phrase or word, located under “Replace with” from the “Find...” window.

Shift Right Text/Shift Left Text

Indents and leading spaces are very important concepts in Python. The first option works similar to the Tab key on your keyboard, the second one removes a tab.

Script

This menu gives you some basic tools to check and execute the currently loaded script, and is especially useful for debugging.

 

 

Clear

This function works similar to “New” from the "File" menu, but without asking you whether you want to store the script. You cannot undo this action.

Show Suggestions

To show commands that could match the currently entered phrase, choose this option. Normally, this is done automatically, but if you have turned off the auto completion function, you can still call it manually from here.

Run

Start your script with this command and watch it working.

Check Syntax

This is a very important feature for debugging. Before the script is executed you can check if there are any errors or undefined variables. Especially copied/pasted scripts from other sources should go through a syntax check.

Help

RealFlow also offers an comprehensive help system for Python scripting, offering a complete reference for all commands, as well as individual help for single keywords.

 

 

Show RealFlow Scripting Reference...

This function calls RealFlow’s Help Viewer and directly branches to the built-in Python reference, where you can find out more about all commands available.

Show Selected Keyword Info

To make use of this convenient function it is not necessary to mark an entire word, because RealFlow automatically detects start and stop. So you only have to place the cursor somewhere “inside” a command and choose this feature to display the available information.