didnt reply to this in a while cause I opted to just use the AI layers to PNG script. I tried it again now (with my full puppet as well as with only one layer like Shiu sugested) on PS CC and I got the same error except on line227 instead of line222
Then I tried it on a PS CS6 and I dont get the error. go figure. Only thing is unlike the AI script it didnt create a folder for each group (which are called layers in AI O_o) I have the parts grouped like ARMS, LEGS, TORSO, etc and I would like to keep that if the feature's available. if not considering this creates a json it's ok.