Hi,
I think you’d better figure out how many worksheets in your workbook at first. Try the scripts below and make sure that there are more than 8 worksheets in your workbook.
Loop (num,1,page.nlayers)
{
type "layer number $(num)";
};
On the other hand, I don’t think the loop can start from 0 as your description. You may change it from 1 to halfcyclenumber if you want the loop over sheets A1, A2, A3...Ahalfcyclenumber.
In fact, Origin provides various tools to help you to debug your LabTalk scripts. I think you can find a way to debug your code on this page:
http://www.originlab.com/doc/LabTalk/Tutorials/Tutorial-Debug
Hope it helps.
Yuki
OriginLab