How to Use Add a Script
ModulesTo add a a project script, simply right click the Project Library item and click the New Script option.
Image Removed
Image Added
Scripts and Packages
There are two main types of resources under the Project Library.
- Scripts - Each script resource can contain many functions and objects.
- Packages - Each Package effectively acts as a folder, allowing you to better organize each script resource.
Usage Example
For example, let's suppose you added the following script module named myFuncs
, whose body is shown below.
Code Block |
---|
|
def hello():
return "Hi there!" |
Image Modified
Once we save our project, we can now call this function from anywhere within the project using the following syntax
Code Block |
---|
language | py |
---|
title | Python - Calling the Project Script |
---|
|
myFuncs.hello() |
Info |
---|
title | Don't Forget to Save |
---|
|
Project scripts are not accessible to the other resources until the project is saved. |
For example, we could open the Script Console (Tools menu > Script Console), write the following, and execute the script.

Each script resource can contain multiple functions and objects. Note that as you add new function definitions, the list on the right will populate, allowing you a quick way to navigate through long scripts.
Image Modified