📋 Metadata

💬 Content

execute_script() fundamentally returns True by specification, so it cannot be used as a function object, which is why the error occurs.

When passing arguments to a script, they should be passed as kwargs to execute_script().

# command tab
execute_script("greeting.py", msg="Hello")
# scripts/greeting.py
def say_hello(msg):
    print(msg)
say_hello(kwargs["msg"])

When you want to get a return value from a script, store it in a variable called return_value.

# command tab
msg = execute_script("hi.py"); print(msg)
# scripts/hi.py
return_value = "Hi!"

If this explanation doesn’t clarify things for you, please share the scripts you’re using and details about your setup.


🔗 View on Blender Artists