I can count the number of items in a collection by creating a FolderEnum object with FSUtil.ReadDir(coll) and then using the FolderEnum.Next(-1) method to populate a vector. Is there any way of getting a count without the overhead of reading the collection or is the overhead so negligible that I should not be concerned.
I don't think the count can be read directly, but the overhead is probably negligible unless your script does it thousands of times.
This works, too, but I don't know if it's faster:
cmd.ClearFiles();
cmd.AddFilesFromFolder('coll://test');
DOpus.Output(cmd.filecount);