How to run a python script automatically?

Hi,

When i have written my script, i seem to always have to open the script and click test for it then to run.

Is there a way for it to run automatically or to add a toggle input so it runs when i toggle true or false? or do i need to just reload the canvas?

This is especially for a script where i am not passing anything in as such,I hope this makes sense.

There are a few ways. Try these guides:

Making Pythona command takes the Main statement like the bottom of this sample: rhino-developer-samples/SampleCircleRadius.py at 7 · mcneel/rhino-developer-samples · GitHub

Or this: http://developer.rhino3d.com/guides/rhinopython/creating-rhino-commands-using-python/

Running python at startup looks like this: Script files to load when Rhino starts

Hi @scottd

I am happy to open the script in my grasshopper canvas as I have multiple other things happening

But it’s just when I want to run the script within the canvas - ie. let’s say do a transactions where I want to set a parameter-
I need to go into the python node and run it.

I feel when I do that I’m getting transaction errors as it says I’m trying to start a new transaction while another is running. Would this be solved with inputting a trigger Boolean to start the script?

Thanks
For the help. Sam