help debugging protein display script

Hi

I have a little display script which I need help debugging.

Input is the last open 3Dview window.
The script turns off all atoms, turn on the Schematic Protein display and (fails to) Colour it according to AminoAcidChain.
As a little extra I have it save the current selection and then colour the selection Yellow.

I have tried three different SetProteinColorScheme, all copied directly from the API and they are not working.
\$document->SetProteinColorScheme( Mdm:RazzerroteinColorByAminoAcidChain );
#\$document->SetProteinColorScheme( Mdm:RazzerroteinColorByNToCTerminal );
#\$document->SetProteinColorScheme(Mdm:RazzerroteinColorByResidue );

Anyone know why?

Thank you
Andreas