Script Update ?
can script below updated photoshop cs5, possible add ability or option maybe though configurator have script save layer group specific name?
#target photoshop main(); // calls other functions change visibility of layer, duplicate // document in psd format , save document. function main(){ if(documents.length > 0 && app.activedocument.activelayer.typename == "layerset") { var layername=activedocument.activelayer.name; var savepath = decodeuri(activedocument.path); var thefilename = app.activedocument.name; // xbytor regexp; var basename = thefilename.match(/(.*)\.[^\.]+$/)[1]; if (basename.indexof(layername) != -1) { var savename = basename.slice(0, basename.indexof(layername)+1) } else { var savename = basename; }; var thefile = duplayers(); var savefile= file(savepath+"/"+savename+"_"+layername+".psd"); savepsd(savefile, thefile); thefile.close(saveoptions.donotsavechanges); } else {alert ("select layer group, not solo layer")} }; //copies layers in new document function duplayers() { var desc143 = new actiondescriptor(); var ref73 = new actionreference(); ref73.putclass( charidtotypeid('dcmn') ); desc143.putreference( charidtotypeid('null'), ref73 ); desc143.putstring( charidtotypeid('nm '), "_"+activedocument.activelayer.name+".psd" ); var ref74 = new actionreference(); ref74.putenumerated( charidtotypeid('lyr '), charidtotypeid('ordn'), charidtotypeid('trgt') ); desc143.putreference( charidtotypeid('usng'), ref74 ); executeaction( charidtotypeid('mk '), desc143, dialogmodes.no ); return app.activedocument }; //saves file in psd format function savepsd(savefile, thefile){ psdsaveoptions = new photoshopsaveoptions(); psdsaveoptions.embedcolorprofile = true; psdsaveoptions.alphachannels = true; thefile.saveas(savefile, psdsaveoptions, true, extension.lowercase); };
strongbeaver wrote:
can script below updated photoshop cs5, possible add ability or option maybe though configurator have script save layer group specific name?
using cs5 32 bit opend file create layer group out of layers targeted layer group , ran scrip , saved new document filename_groupname.psd worked is file. uses current filename , target layer group create output filename ans saves psd file in same folder source file???
More discussions in Photoshop Scripting
adobe
Comments
Post a Comment