Been doing some investigation:
I pasted the script into the Fusion 9 console and instead of the error in line 195 it gave a different error referencing line 117: attrs = tool:GetAttrs()
So in the line above I added
"tool = tool or comp.ActiveTool"
and when I paste the entire script into the console (with the Loader selected) it now works fine.
But when I run the script from the Scripts menu it still gives the same error in line 195 even after getting it to work from the console...
For the moment if I have to do it that way it sure beats manually setting up the different passes, but it would be great to get it to work directly from the scripts menu
I hope somebody has the answer