Separating Layers into Different Files with Scripting

Can we run a script on a rhino file that can separate 1 file with 3 layers into 3 separate files?

Yes, you can…

https://wiki.mcneel.com/developer/scriptsamples/exportlayerobjects