Assorted Photoshop scripts from https://github.com/antoniocosta/photoshopscripts
My version has this name structure : artboardname_layercompname.extension
Copy the script in Photoshop's script directory. You will find it under File > Scripts > Layer Comps To Artboard Files...