Command to create Sublayer with Random Color

I have various macros to create structures with the file… the macros have lines looking like this:
-layer new WORKING

Is there a way to also assign a random color to each of those folders in the same way the command in V8 does “Create Sublayer with Random Color”?

Thanks,
David

You can do this with a script, see also

Thanks, I will take a closer look at that.