Here it is in full, its all borrowed. So not to clean as yet. #target photoshop main(); function main(){ if(!documents.length) return; var Info = getNamesPlusIDs().sort(); var Name = app.activeDocument.name.replace(/\.[^\.]+$/, ''); var file = new File(Folder.desktop + "/" + Name + ".txt"); file.open("w", "TEXT", "????"); $.os.search(/windows/i) != -1 ? file.lineFeed = 'windows' : file.lineFeed = 'macintosh'; for(var a in Info) file.writeln(Info.toString()); file.close(); } function getNamesPlusIDs(){ var ref = new ActionReference(); ref.putEnumerated( charIDToTypeID('Dcmn'), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') ); var count = executeActionGet(ref).getInteger(charIDToTypeID('NmbL')) +1; var Names=[]; try{ activeDocument.backgroundLayer; var i = 0; }catch(e){ var i = 1; }; for(i;i<count;i++){ if(i == 0) continue; ref = new ActionReference(); ref.putIndex( charIDToTypeID( 'Lyr ' ), i ); var desc = executeActionGet(ref); var layerName = desc.getString(charIDToTypeID( 'Nm ' )); var Id = desc.getInteger(stringIDToTypeID( 'layerID' )); if(layerName.match(/^<\/Layer group/) ) continue; var vMask = desc.getBoolean(stringIDToTypeID('hasVectorMask' )); try{ var adjust = typeIDToStringID(desc.getList (stringIDToTypeID('adjustment')).getClass (0)); if(vMask == true){ adjust = false; var Shape = true; } }catch(e){var adjust = false; var Shape = false;} var layerType = typeIDToStringID(desc.getEnumerationValue( stringIDToTypeID( 'layerSection' ))); var isLayerSet =( layerType == 'layerSectionContent') ? false:true; var Vis = desc.getBoolean(stringIDToTypeID( 'visible' )); var descBounds = executeActionGet(ref).getObjectValue(stringIDToTypeID( "bounds" )); var X = descBounds.getUnitDoubleValue(stringIDToTypeID('left')); var Y = descBounds.getUnitDoubleValue(stringIDToTypeID('top')); var W = descBounds.getUnitDoubleValue(stringIDToTypeID('right')); var H = descBounds.getUnitDoubleValue(stringIDToTypeID('bottom')); //var W = XW - X; //var H = XH - Y; var idCrop = charIDToTypeID( "Crop" ); var desc290 = new ActionDescriptor(); var idT = charIDToTypeID( "T " ); var desc291 = new ActionDescriptor(); var idTop = charIDToTypeID( "Top " ); var idPxl = charIDToTypeID( "#Pxl" ); desc291.putUnitDouble( idTop, idPxl, 2309.843750 ); var idLeft = charIDToTypeID( "Left" ); var idPxl = charIDToTypeID( "#Pxl" ); desc291.putUnitDouble( idLeft, idPxl, 2324.187500 ); var idBtom = charIDToTypeID( "Btom" ); var idPxl = charIDToTypeID( "#Pxl" ); desc291.putUnitDouble( idBtom, idPxl, 3862.843750 ); var idRght = charIDToTypeID( "Rght" ); var idPxl = charIDToTypeID( "#Pxl" ); desc291.putUnitDouble( idRght, idPxl, 3359.187500 ); var idRctn = charIDToTypeID( "Rctn" ); desc290.putObject( idT, idRctn, desc291 ); var idAngl = charIDToTypeID( "Angl" ); var idAng = charIDToTypeID( "#Ang" ); desc290.putUnitDouble( idAngl, idAng, 0.000000 ); var idDlt = charIDToTypeID( "Dlt " ); desc290.putBoolean( idDlt, false ); var idcropAspectRatioModeKey = stringIDToTypeID( "cropAspectRatioModeKey" ); var idcropAspectRatioModeClass = stringIDToTypeID( "cropAspectRatioModeClass" ); var idtargetSize = stringIDToTypeID( "targetSize" ); desc290.putEnumerated( idcropAspectRatioModeKey, idcropAspectRatioModeClass, idtargetSize ); var idWdth = charIDToTypeID( "Wdth" ); var idRlt = charIDToTypeID( "#Rlt" ); desc290.putUnitDouble( idWdth, idRlt, 28913.385827 ); var idHght = charIDToTypeID( "Hght" ); var idRlt = charIDToTypeID( "#Rlt" ); desc290.putUnitDouble( idHght, idRlt, 43370.078740 ); executeAction( idCrop, desc290, DialogModes.NO ); app.activeDocument.crop([X,Y,W,H]); //if(Vis && !isLayerSet && !adjust) Names.push([[layerName], , , , ]); }; return Names; };
... View more