Oops. I was running the script with a trial version of 3DGS which doesn't support shaders (I thought it was based on the commercial version, not the extra version). So that's pretty much the only problem I suppose. Sorry for wasting your time. I'll give this a try again when I buy the full version.
Thanks for your help anyway.