Getting script to run without attaching it to a GameObject - how?

Glad you got it working.

For the future though, please always use code-tags when posting code if you’re not aware of it. It makes it easier to refer to line numbers etc too.

Good luck.