How to batch export layers in png in cc files
I have a problem with an export of layers to the script files I want to layer export batch in png and this script I have seems to be the only I can whenever I run the script I get this error message "Could not complete the action because the destination folder does not exist" the script required me to hardcode the my destination path the path that I need is "C:/users/Tim/Desktop/decors/png / '. I'm not completely sure why its registrant, that there is not any help would be greatly appreciated. I tried to contact the creator, but the post that it was was very old.
activate the double click from the Macintosh Finder or Windows Explorer
#target photoshop
//=================================================================
Globals
//=================================================================
exportPath var = ' / users/pedr/Documents/work/Clients/routes/Learning_Hub/Source/Comics/export ";
exportPath = exportPath + "/ layers ';
Localized UI strings
var strTitle = localize("$$$/JavaScripts/X2L/Title=X2L");
var strButtonRun = localize("$$$/JavaScripts/X2L/Run=Run");
var strButtonCancel = localize("$$$/JavaScripts/X2L/Cancel=Cancel");
var strHelpText = locate ("$$$ / JavaScripts/X2L/Help = Please specify the format and location for the registration of each layer as a file.");
var strLabelDestination = localize("$$$/JavaScripts/X2L/Destination=Destination:");
var strButtonBrowse = locate ("$$$ / JavaScripts/X2L/Browse = & Browse...");
var strLabelFileNamePrefix = locate ("$$$ / JavaScripts/X2L/FileNamePrefix = filename prefix :"); ")
var strCheckboxVisibleOnly = locate ("$$$ / JavaScripts/X2L/VisibleOnly only = & layers visible only");
var strLabelFileType = locate ("$$$ / JavaScripts/X2L/FileType = Type of file :"); ")
var strCheckboxIncludeICCProfile = locate ("$$$ / JavaScripts/X2L/IncludeICC = & include ICC profile");
var strJPEGOptions = locate ("$$$ / JavaScripts/X2L/JPEGOptions = Options JPEG :"); ")
var strLabelQuality = localize("$$$/JavaScripts/X2L/Quality=Quality:");
var strCheckboxMaximizeCompatibility = locate ("$$$ / JavaScripts/X2L/enlarge = & maximize compatibility");
var strTIFFOptions = locate ("$$$ / JavaScripts/X2L/TIFFOptions = TIFF Options :"); ")
var strLabelImageCompression = locate ("$$$ / JavaScripts/X2L/ImageCompression = Compression of Image :"); ")
var strNone = localize("$$$/JavaScripts/X2L/None=None");
var strPDFOptions = locate ("$$$ / JavaScripts/X2L/PDFOptions = PDF Options :"); ")
var strLabelEncoding = localize("$$$/JavaScripts/X2L/Encoding=Encoding:");
var strTargaOptions = locate ("$$$ / JavaScripts/X2L/TargaOptions = Options of Targa :"); ")
var strLabelDepth = localize("$$$/JavaScripts/X2L/Depth=Depth:");
var strRadiobutton16bit = localize("$$$/JavaScripts/X2L/Bit16=16bit");
var strRadiobutton24bit = localize("$$$/JavaScripts/X2L/Bit24=24bit");
var strRadiobutton32bit = localize("$$$/JavaScripts/X2L/Bit32=32bit");
var strBMPOptions = locate ("$$$ / JavaScripts/X2L/BMPOptions = Options of BMP :"); ")
var strAlertSpecifyDestination = locate ("$$$ / JavaScripts/X2L/SpecifyDestination = please specify destination.");
var strAlertDestinationNotExist = locate ("$$$ / JavaScripts/X2L/DestionationDoesNotExist = Destination does not exist.");
var strTitleSelectDestination = locate ("$$$ / JavaScripts/X2L/SelectDestination = Select Destination");
var strAlertDocumentMustBeOpened = locate ("$$$ / JavaScripts/X2L/OneDocument = you must have a document open for export!");
var strAlertNeedMultipleLayers = locate ("$$$ / JavaScripts/X2L/NoLayers = you need a document with several layers to export!");
var strAlertWasSuccessful = locate ("$$$ / JavaScripts/X2L/success = succeeded.");
var strUnexpectedError = locate ("$$$ / JavaScripts/X2L/Unexpected = unexpected error");
var strMessage = localize("$$$/JavaScripts/X2L/Message=X2L");
var stretQuality = locate (' $$$ / locale_specific/JavaScripts/X2L/ETQualityLength = 30 ");
var stretDestination = locate (' $$$ / locale_specific/JavaScripts/X2L/ETDestinationLength = 160 ');
var strddFileType = locate (' $$$ / locale_specific/JavaScripts/X2L/DDFileType = 100 ');
var strpnlOptions = locate (' $$$ / locale_specific/JavaScripts/X2L/PNLOptions = 100 ');
var strPNG8Options = locate ("$$$ / JavaScripts/X2L/PNG8Options = PNG-8 Options :"); ")
var strCheckboxPNGTransparency = localize("$$$/JavaScripts/X2L/Transparency=Transparency");
var strCheckboxPNGInterlaced = localize("$$$/JavaScripts/X2L/Interlaced=Interlaced");
var strCheckboxPNGTrm = locate ("$$$ / JavaScripts/X2L/Trim = Trim layers");
var strPNG24Options = locate ("$$$ / JavaScripts/X2L/PNG24Options = Options format PNG-24 :"); ")
the drop in the index from the file type list
var png24Index = 7;
main();
///////////////////////////////////////////////////////////////////////////////
Functions
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
Function: main
Use: the core routine for this script
Entry: < no >
Return: < no >
///////////////////////////////////////////////////////////////////////////////
main() {} function
If (app.documents.length < = 0) {}
If (DialogModes.NO! = app.playbackDisplayDialogs) {}
Alert (strAlertDocumentMustBeOpened);
}
return to "Cancel"; quitting smoking, return "Cancel" (do not localize) makes the palette actions not to register our script
}
var exportInfo = new Object();
initExportInfo (exportInfo);
Search the last used via Photoshop register params, getCustomOptions rise if none does not exist
try {}
}
{catch (e)}
It's ok if we have any options, continue with the default settings
}
try {}
var Nomdoc = app.activeDocument.name; record the name of app.activeDocument before double.
var layerCount = app.documents [docName].layers.length;
var layerSetsCount = app.documents [docName].layerSets.length;
If ((layerCount < = 1) & & (layerSetsCount < = 0)) {}
If (DialogModes.NO! = app.playbackDisplayDialogs) {}
Alert (strAlertNeedMultipleLayers);
return to "Cancel"; quitting smoking, return "Cancel" (do not localize) makes the palette actions not to register our script
}
} else {}
var rememberMaximize;
var needMaximize = exportInfo.psdMaxComp? QueryStateType.ALWAYS: QueryStateType.NEVER;
app.activeDocument = app.documents [docName];
var duppedDocument = app.activeDocument.duplicate ();
duppedDocument.activeLayer = duppedDocument.layers [duppedDocument.layers.length - 1]; to remove the
setInvisibleAllArtLayers (duppedDocument);
exportChildren (duppedDocument, app.documents [docName], exportInfo, duppedDocument, exportInfo.fileNamePrefix);
duppedDocument.close (SaveOptions.DONOTSAVECHANGES);
If (rememberMaximize! = undefined) {}
app.preferences.maximizeCompatibility = rememberMaximize;
}
If (DialogModes.ALL == app.playbackDisplayDialogs) {}
Alert (strTitle + strAlertWasSuccessful);
}
app.playbackDisplayDialogs = DialogModes.ALL;
}
} catch (e) {}
If (DialogModes.NO! = app.playbackDisplayDialogs) {}
Alert (e);
}
return to "Cancel"; quitting smoking, return "Cancel" (do not localize) makes the palette actions not to register our script
}
}
///////////////////////////////////////////////////////////////////////////////
Function: settingDialog
Use: pop of the UI and get the user settings
Entry: object of exportInfo containing our settings
Back: OK, the info in the dialog box is set to the exportInfo object
///////////////////////////////////////////////////////////////////////////////
function settingDialog (exportInfo) {}
return;
}
///////////////////////////////////////////////////////////////////////////////
Function: hideAllFileTypePanel
Use: hide all panels in common stocks
Entered: < none >, dlgMain is a global for this script
Return: < any >, all the panels are now hidden
///////////////////////////////////////////////////////////////////////////////
function hideAllFileTypePanel() {}
}
///////////////////////////////////////////////////////////////////////////////
Function: initExportInfo
Use: create our default settings
Entry: a new object
Return: a new object with the default params
///////////////////////////////////////////////////////////////////////////////
function initExportInfo (exportInfo) {}
exportInfo.destination = new String (exportPath);
exportInfo.fileNamePrefix = new String ("untitled_");
exportInfo.visibleOnly = false;
exportInfo.fileType = png24Index;
exportInfo.icc = true;
exportInfo.png24Transparency = true;
exportInfo.png24Interlaced = false;
exportInfo.png24Trim = true;
try {}
exportInfo.destination is Folder (new String (exportPath)) .fsName;. destination folder
var tmp = app.activeDocument.fullName.name;
exportInfo.fileNamePrefix = decodeURI (tmp.substring (0, tmp.indexOf("."))); part of the body filename
} catch (someError) {}
exportInfo.destination = new String (exportPath);
exportInfo.fileNamePrefix = app.activeDocument.name; part of the body filename
}
}
///////////////////////////////////////////////////////////////////////////////
Function: saveFile
Use: the routine of work, take our params and save the file accordingly
Entry: refers to the document, the name of the output file,
export of information object containing more information
Return: < any >, a file on disk
///////////////////////////////////////////////////////////////////////////////
function saveFile (docRef, fileNameBody, exportInfo) {}
saveFile (docRef, fileNameBody, exportInfo, false, true);
function saveFile (docRef, fileNameBody, exportInfo, interlacedValue, transparencyValue) {}
var id6 = charIDToTypeID ('Expr');
var desc3 = new ActionDescriptor();
7 var = charIDToTypeID ("Usng");
var desc4 = new ActionDescriptor();
id8 var = charIDToTypeID ("Op");
id9 var = charIDToTypeID ('SWOp');
var id10 = charIDToTypeID ("OpSa");
Desc4.putEnumerated (id8, id9, id10);
id11 var = charIDToTypeID ("Fmt");
id12 var = charIDToTypeID ("IRFm");
id13 var = charIDToTypeID ("PN24");
Desc4.putEnumerated (id11, id12, id13);
var id14 = charIDToTypeID ("Introduction");
Desc4.putBoolean (id14, interlacedValue);
id15 var = charIDToTypeID ("Trns");
Desc4.putBoolean (id15, transparencyValue);
id16 var = charIDToTypeID ("Mtt");
Desc4.putBoolean (id16, true);
var id17 = charIDToTypeID ("MttR");
Desc4.putInteger (id17, 255);
var id18 = charIDToTypeID ("MttG");
Desc4.putInteger (id18, 255);
id19 var = charIDToTypeID ("MttB");
Desc4.putInteger (id19, 255);
id20 var = charIDToTypeID ("SHTM");
Desc4.putBoolean (id20, false);
id21 var = charIDToTypeID ("SImg");
Desc4.putBoolean (id21, true);
id22 var = charIDToTypeID ("OHSA");
Desc4.putBoolean (id22, false);
var id23 = charIDToTypeID ("SSLt");
var list1 = new ActionList();
Desc4.putList (id23, list1);
var id24 = charIDToTypeID ("DIDr");
Desc4.putBoolean (id24, false);
id25 var is charIDToTypeID ('In');.
Desc4.putPath (id25, new file (exportPath + "C:/users/Tim/Desktop/decors/png /" + fileNameBody + ".png"));
var delayed26 = stringIDToTypeID ('SaveForWeb');
Desc3.putObject (7, delayed26, desc4);
executeAction (id6, desc3, DialogModes.NO);
}
}
///////////////////////////////////////////////////////////////////////////////
Function: zeroSuppress
Use: return a string completed up to the figure (s)
Entry: num to convert, the number of necessary digits
Return: string padded all numbers
///////////////////////////////////////////////////////////////////////////////
function zeroSuppress (num, number) {}
var tmp = num.toString ();
While (tmp.length < number) {}
tmp = '0' + tmp;
}
return tmp;
}
///////////////////////////////////////////////////////////////////////////////
Function: setInvisibleAllArtLayers
Use: Unlock and make invisible all the layers of art, recursively
Entry: document or layerset
Back: all layers of art are unlocked and invisible
///////////////////////////////////////////////////////////////////////////////
function setInvisibleAllArtLayers (obj) {}
for (var i = 0; i < obj.artLayers.length; i ++) {}
obj.artLayers [i] .allLocked = false;
obj.artLayers [i] .visible = false;
}
for (var i = 0; i < obj.layerSets.length; i ++) {}
setInvisibleAllArtLayers (obj.layerSets [i]);
}
}
///////////////////////////////////////////////////////////////////////////////
Function: removeAllInvisibleArtLayers
Use: remove all layers invisible art, recursively
Entry: document or layer set
Return: < any >, all invisible layers are now gone
///////////////////////////////////////////////////////////////////////////////
function removeAllInvisibleArtLayers (obj) {}
for (var i = obj.artLayers.length - 1; 0 < = i; i--) {}
try {}
{if(!obj.artLayers[i].visible)}
obj.artLayers [i] .remove ();
}
}
{} catch (e)
}
}
for (var i = obj.layerSets.length - 1; 0 < = i; i--) {}
removeAllInvisibleArtLayers (obj.layerSets [i]);
}
}
///////////////////////////////////////////////////////////////////////////////
Function: removeAllEmptyLayerSets
Use: find everything empty layer sets and remove them, recursively
Entry: document or layer set
Return: empty layer sets are now gone
///////////////////////////////////////////////////////////////////////////////
function removeAllEmptyLayerSets (obj) {}
var foundEmpty = true;
for (var i = obj.layerSets.length - 1; 0 < = i; i--) {}
If (removeAllEmptyLayerSets (obj.layerSets [i])) {}
obj.layerSets [i] .remove ();
} else {}
foundEmpty = false;
}
}
If (obj.artLayers.length > 0) {}
foundEmpty = false;
}
Return foundEmpty;
}
///////////////////////////////////////////////////////////////////////////////
Function: zeroSuppress
Use: return a string completed up to the figure (s)
Entry: num to convert, the number of necessary digits
Return: string padded all numbers
///////////////////////////////////////////////////////////////////////////////
function removeAllInvisible (docRef) {}
removeAllInvisibleArtLayers (docRef);
removeAllEmptyLayerSets (docRef);
}
///////////////////////////////////////////////////////////////////////////////
Function: exportChildren
Use: find all the children in this document to record
Entry: duplicate the original of the document, export info.
Document reference, from file name
Return: < any >, the documents are saved accordingly
///////////////////////////////////////////////////////////////////////////////
function exportChildren (dupObj, orgObj, exportInfo, dupDocRef, fileNamePrefix) {}
for (var i = 0; i < dupObj.artLayers.length; i ++) {}
If (exportInfo.visibleOnly) {/ / only visible layer}
If (! orgObj.artLayers [i] .visible) {}
continue;
}
}
dupObj.artLayers [i] .visible = true;
var NomCouche = dupObj.artLayers [i] .name; store the name of the layer before change doc
var duppedDocumentTmp = dupDocRef.duplicate ();
If ((png24Index == exportInfo.fileType) |) (png8Index is exportInfo.filetype)) {/ / PSD: maintain transparency}
removeAllInvisible (duppedDocumentTmp);
PNGFileOptions
If (activeDocument.activeLayer.isBackgroundLayer == false) {//is it something other than a background layer?}
app.activeDocument.trim (TrimType.TRANSPARENT);
}
} else {/ / all flatten}
duppedDocumentTmp.flatten ();
}
Edit
var Nomdoc = app.activeDocument.name;
For some reason any indexOf fails if we include the '-', so we use 'copy' and decrement the index of 1.
docName = docName.slice (0, docName.indexOf('copy')-1);
var fileNameBody = (docName + '_' + layerName) .toLowerCase ();
fileNameBody = fileNameBody.replace (/ [:------/------* \? \ "\ <>\ \ |"]) /g, "_"); // '/\:*?" <> |' -> « _ »
If {(fileNameBody.length > 120)
fileNameBody = fileNameBody.substring (0.120);
}
saveFile (duppedDocumentTmp, fileNameBody, exportInfo);
duppedDocumentTmp.close (SaveOptions.DONOTSAVECHANGES);
dupObj.artLayers [i] .visible = false;
}
for (var i = 0; i < dupObj.layerSets.length; i ++) {}
If (exportInfo.visibleOnly) {/ / only visible layer}
If (! orgObj.layerSets [i] .visible) {}
continue;
}
}
var fileNameBody = fileNamePrefix;
fileNameBody += '_' + zeroSuppress (i, 4) + "s";
exportChildren (dupObj.layerSets [i], orgObj.layerSets [i], exportInfo, dupDocRef, fileNameBody); recursive call
}
}
///////////////////////////////////////////////////////////////////////////////
Function: objectToDescriptor
Use: create an ActionDescriptor of a JavaScript object
Entry: JavaScript Object (o)
unique chain of the object (s)
Pre process converter (f)
Return: ActionDescriptor
NOTE: Only, boolean, string, number and UnitValue are supported, use a pre processor
to convert other types (f) to one of these forms.
REUSE: This routine is used in other scripts. Please update those if you
change. I'm not include using or eval statements that I want these
stand-alone scripts.
///////////////////////////////////////////////////////////////////////////////
function objectToDescriptor (o, s, f) {}
o = {};
var d = new ActionDescriptor;
var l = o.reflect.properties.length;
d.putString (app.charIDToTypeID ('Msge"), s);
for (var i = 0; i < l; i ++) {}
var k = o.reflect.properties [i] m:System.NET.SocketAddress.ToString ();
If (k == '__proto__' | k == '__count__' | k == '__class__' | k == 'reflect')
continue;
var v = o [k];
k = app.stringIDToTypeID (k);
Switch (typeof (v)) {}
case 'boolean ':
d.putBoolean (k, v);
break;
case "string":
d.putString (k, v);
break;
case 'number ':
d.putDouble (k, v);
break;
by default:
{
If (v instanceof UnitValue) {}
UC var = new Object;
UC ["px"] = charIDToTypeID ("#Rlt"); unitDistance
UC ["%"] = charIDToTypeID ("#Prc"); unitPercent
d.putUnitDouble (k, uc [v.type], v.value);
} else {}
throw (new Error ("Unsupported type in objectToDescriptor" + typeof (v)));
}
}
}
}
return d;
}
///////////////////////////////////////////////////////////////////////////////
Function: descriptorToObject
Use: updating a JavaScript from an ActionDescriptor object
Entry: JavaScript Object (o), current to update object (output)
Photoshop ActionDescriptor (d), descriptor shoot again for object params of
unique chain of the object (s)
JavaScript function (f), position the utility of conversion process
Back: Nothing, update is applied to spent in JavaScript Object (o)
NOTE: Only, boolean, string, number and UnitValue are supported, use a post-processor
to convert other types (f) to one of these forms.
REUSE: This routine is used in other scripts. Please update those if you
change. I'm not include using or eval statements that I want these
stand-alone scripts.
///////////////////////////////////////////////////////////////////////////////
function descriptorToObject (o, d, f, s) {}
var l = d.count;
If {(l)
var keyMessage = app.charIDToTypeID ("Msge");
If (d.hasKey (keyMessage) & & (s! = d.getString (keyMessage))) return;
}
for (var i = 0; i < l; i ++) {}
var k = d.getKey (i); // i + 1 ?
var t = d.getType (k);
STRK = app.typeIDToStringID (k);
switch (t) {}
case DescValueType.BOOLEANTYPE:
o [strk] = d.getBoolean (k);
break;
case DescValueType.STRINGTYPE:
o [strk] = d.getString (k);
break;
case DescValueType.DOUBLETYPE:
o [strk] = d.getDouble (k);
break;
case DescValueType.UNITDOUBLE:
{
UC var = new Object;
UC [charIDToTypeID ("#RLT")] = "px"; unitDistance
UC [charIDToTypeID ("#PRC")] = '% '; unitPercent
UC [charIDToTypeID ("#pxl")] = "px"; unitPixels
UT var = d.getUnitDoubleType (k);
var uv = d.getUnitDoubleValue (k);
o [strk] = new UnitValue (uv, uc [ut]);
}
break;
case DescValueType.INTEGERTYPE:
case DescValueType.ALIASTYPE:
case DescValueType.CLASSTYPE:
case DescValueType.ENUMERATEDTYPE:
case DescValueType.LISTTYPE:
case DescValueType.OBJECTTYPE:
case DescValueType.RAWTYPE:
case DescValueType.REFERENCETYPE:
by default:
throw (new Error ("Unsupported type in descriptorToObject" + t));
}
}
If (undefined! = f) {}
o = f (o);
}
}
///////////////////////////////////////////////////////////////////////////////
Function: preProcessExportInfo
Usage: Convert Photoshop enums to strings for storage
Entry: Object of JavaScript of my parameters for this script
Return: Object of JavaScript with objects converted for storage
///////////////////////////////////////////////////////////////////////////////
function preProcessExportInfo (o) {}
o.tiffCompression = o.tiffCompression.toString ();
o.pdfEncoding = o.pdfEncoding.toString ();
o.targaDepth = o.targaDepth.toString ();
o.bmpDepth = o.bmpDepth.toString ();
Return to o;
}
///////////////////////////////////////////////////////////////////////////////
Function: postProcessExportInfo
Usage: convert strings in destocking Photoshop enums
Entry: Object of my parameters a string JavaScript
Return: Object of JavaScript with objects in the form of enum
///////////////////////////////////////////////////////////////////////////////
function postProcessExportInfo (o) {}
o.tiffCompression = eval (o.tiffCompression);
o.pdfEncoding = eval (o.pdfEncoding);
o.targaDepth = eval (o.targaDepth);
o.bmpDepth = eval (o.bmpDepth);
Return to o;
}
///////////////////////////////////////////////////////////////////////////
Function: StrToIntWithDefault
Usage: convert a string to a number, first depriving all the characters
Input: a string and a number of default
Return: a number
///////////////////////////////////////////////////////////////////////////
function StrToIntWithDefault (s, n) {}
var onlyNumbers = / [^ 0-9] / g;
var t is SS. Replace (onlyNumbers, "");
t = parseInt (t);
If (! isNaN (t)) {}
n = t;
}
return n;
}
End X2L.jsx
The exportPath variable is what you want to change to the beginning. It should read:
var exportPath = "~/Desktop/Backdrops/png/"; exportPath = exportPath + '/layers';//Get rid of this
The line you mentioned above should be:
desc4.putPath( id25, new File( exportPath + fileNameBody + ".png") );
Again, you must be logged in as 'Tim' to access folder of the user. If you're not, you must run the script as an administrator, and then specify the entire path.
Tags: Photoshop
Similar Questions
-
How to convert/export an illustrator in MS publisher file?
Hello world!
I'm in pain with some people that I was help out which now becomes a bit nasty with me.
They asked me to change the file .ai to something, that they can use in MS Publisher, so they can always change.I have tried and searched all hollow... Can not find a way to do it, or if it is still possible?
They wrote me this:
Normally, when you save a program that you also have the option to import or to export to a different document type, save the original formats.I need you to try and export adobe in MS Publisher format files. We do not want to buy Adobe Illustrator. We do not want that he used for creaing drawings, logos, etc. because we must be able to make changes at any time. Please try to export to MS Publisher.
Export the document should enable us to keep the layout and formats without having to convert them into eps, then import via an add-on is filtered.
I would like the brochure and all work of art made to date recorded in this format.
If you can not do let me know
Is there someone here who can can tell me how to?THANK YOU VERY MUCH!
Vicki
MSPub will import any graphic / image format that you can import into other Office applications, ranging from the EMF / WMF / EPS / PDF for vectors to BMP/PNG/TIFF for pixel graphics. There is no such thing as a format specific chart for MSPub. Only MSPub can create (clip) extracted from the art, but they are essentially the documents just trimmed Publisher who re - use the main document format to encapsulate other works of art, imported or created in the program. So, really, your customer demand is insane either. If put a WMF file is asking too much, so I don't really know if anybody out there can be more unfit then their...
Mylenium
-
Export layers of resolution change Script files
When I run this script to save my layers as .png files it turns at 72 dpi... I need to keep 300 dpi as the original file. Is it possible to change this? Thanks in advance for any help!
Kari Holt
iMac OS 10.5.8
CS4 Extended
Open the script is a text editor. I recommend ExtendScript Toolkit that ships with Photoshop.
Find the line png24Index:
Highlight all between this line and the line that reads the break. Replace the code below.
case png24Index: /* saveFile(docRef, fileNameBody, exportInfo, dlgMain.pnlFileType.pnlOptions.grpPNG24Options.png24Inter.value, dlgMain.pnlFileType.pnlOptions.grpPNG24Options.png24Trans.value); function saveFile( docRef, fileNameBody, exportInfo, interlacedValue, transparencyValue) { var id6 = charIDToTypeID( "Expr" ); var desc3 = new ActionDescriptor(); var id7 = charIDToTypeID( "Usng" ); var desc4 = new ActionDescriptor(); var id8 = charIDToTypeID( "Op " ); var id9 = charIDToTypeID( "SWOp" ); var id10 = charIDToTypeID( "OpSa" ); desc4.putEnumerated( id8, id9, id10 ); var id11 = charIDToTypeID( "Fmt " ); var id12 = charIDToTypeID( "IRFm" ); var id13 = charIDToTypeID( "PN24" ); desc4.putEnumerated( id11, id12, id13 ); var id14 = charIDToTypeID( "Intr" ); desc4.putBoolean( id14, interlacedValue ); var id15 = charIDToTypeID( "Trns" ); desc4.putBoolean( id15, transparencyValue ); var id16 = charIDToTypeID( "Mtt " ); desc4.putBoolean( id16, true ); var id17 = charIDToTypeID( "MttR" ); desc4.putInteger( id17, 255 ); var id18 = charIDToTypeID( "MttG" ); desc4.putInteger( id18, 255 ); var id19 = charIDToTypeID( "MttB" ); desc4.putInteger( id19, 255 ); var id20 = charIDToTypeID( "SHTM" ); desc4.putBoolean( id20, false ); var id21 = charIDToTypeID( "SImg" ); desc4.putBoolean( id21, true ); var id22 = charIDToTypeID( "SSSO" ); desc4.putBoolean( id22, false ); var id23 = charIDToTypeID( "SSLt" ); var list1 = new ActionList(); desc4.putList( id23, list1 ); var id24 = charIDToTypeID( "DIDr" ); desc4.putBoolean( id24, false ); var id25 = charIDToTypeID( "In " ); desc4.putPath( id25, new File( exportInfo.destination + "/" + fileNameBody + ".png") ); var id26 = stringIDToTypeID( "SaveForWeb" ); desc3.putObject( id7, id26, desc4 ); executeAction( id6, desc3, DialogModes.NO ); } */ var saveFile = new File(exportInfo.destination + "/" + fileNameBody + ".png"); pngSaveOptions = new PNGSaveOptions(); pngSaveOptions.interlaced = false; docRef.saveAs(saveFile, pngSaveOptions, true, Extension.LOWERCASE); break;
Note that comments saveForWeb rather code that deletes it if you want to go back. Also, it removes the existing normal comment characters save the code and fix the save option used between bmp and png.
I also recommend that you add comments to the upper part of the realization of script that you have edited the script and save it under a different name.
-
How to make for lots of PNG to JPEG files
I have 10 and even up to 50 PNG files I want to convert to JPEG. However, I have Photoshop 6.0 and want to know how to do this in PS. These png is raw (don't no size)-can I actually size them first? Can convert to JPEG format at 300 DPI and 1500px wide for all final images? I looked aslot tutorials on YouTube but do not include broken accents are trying to speak English... with a lot of noise in the community... they actually waste their time trying to do that.
If there is a clear and concise tutorial or a link somewhere, it would be phenomenal. Suppose I have a dozen PNGs in a folder, what to do next?
You can also use IrfanView batch processing: there is much, much faster than Photoshop.
(A) to download and install IrfanView (one of the most known and popular of the world image viewers). It's a freeware.
(B) open IrfanView. Go to--> BATCH CONVERSION/RENAME FILE (shortcut: B)
(C) follow these steps:
(1) select a conversion mode. I chose the image conversion more rename.
(2) choose jpg as output format.
(3) game of require it quality with this button.
4) go to your folder of entry with pictures.
(5) add all images in your folder with this button. Highlight a selection of images to limit the number of images.
(6) possibly change the naming model. The model can be changed by clicking on the button options.
(7) select the output for processed images folder.
(8) next step!
(D) the dialog box options of image processing is displayed after clicking on the button "Advanced" in the previous step.
(1) set the width on 1500. The height of a blank.
(2) 300 DPI value. Also activate KEEP the PROPORTIONS and USE RESAMPLE FUNCTION (BEST QUALITY).
(3) stops all the MISC settings (especially "create subfolders" and 'delete the original files'. Subfolders will recreate the structure of identical files in your output folder, which is usually not necessary).
(Option 4): the use of another option (automatic sharpness, colors, etc.).
5) click OK when finished.
(E) you are now back to the previous screen of lot. Start batch conversion by clicking on the button START BATCH.
Fact! Since you mentioned that you need to convert thousands of images, note important here is that IrfanView is several times faster than Photoshop. And the lot never - fails with Photoshop, I lived in the past that the batch conversion would cease or fail for any reason any at times.
I did a quick test with a simple 95 images at different sizes with the wishes of parameters the OP. I also used the same JPG quality.
Photoshop CC 2015 Image Processor Pro: 106 seconds
IrfanView: 13 seconds.
IrfanView beat Photoshop by a factor of more than 8 times (!) faster. Now extrapolate this number to thousands of images, and you begin to understand that Photoshop can not be the best choice to perform batch conversions.
-
The option organize bookmarks disappeared in Firefox 4.0. How to organize, import and export bookmarks?
You are welcome.
Please click the button quite useful next to the answer that solved your problem of Firefox support, When you are connected, so this thread is marked as solved.
-
Export Illustrator layers to separate the Illustrator files?
Does anyone know in AI CS4 how to export layers to separate the .ai files? Or third-party plug-ins to do the same thing? Preference, retaining the name of the layer to the new file name.
I have a file .ai laminates with 40 layers of versions of logo that I need to export separate files and I would avoid the obvious "save under" and delete layers road.
Thanks in advance.
Try this. Cut and paste into a text editor and save it in a text file with the .jsx extension. You can either place them in your AICS4 > Presets > Scripts folder and restart AI or run all from file > Scripts > other Scripts.
Beginning
var doc = app.activeDocument;
If (documents.length > 0) {}
Create the illusrtratorSaveOptions object to set options to HAVE
var saveOpts = new IllustratorSaveOptions();
Definition of the IllustratorSaveOptions properties.
saveOpts.embedLinkedFiles = true;
saveOpts.fontSubsetThreshold = 0.0
saveOpts.pdfCompatible = trueIf (doc.saved == false) doc.save ();
for (i = 0; i
If (doc.layers [i] .locked == false) doc.layers [i] .visible = false;
fullDocName = doc.fullName;
var param = doc.name.split('.');
realDocName = param [0];
for (i = 0; i
If (i - 1<0) doc.layers[i].visible="">0)>
else {}
doc. Layers [i - 1] .visible = false;
doc. Layers [i]. Visible = true;
}
If (doc.layers [i] .locked == false) {}
docName = realDocName + doc.layers [i] .name + ".ai";
var saveName = new queue (doc.path + "/" + Nomdoc);
doc.saveAs (saveName, saveOpts);
}
}
doc. Close (SaveOptions.DONOTSAVECHANGES);
doc = null;
App.Open (fullDocName);
}End
-
How batches several layers to JPEG
I have more than 500 layers of different texts on a simple background image. I need to navigate in each of these layers, visibility only and the bottom, and then do the same for the next and save each one out as a separate .jpeg. I know how batch JPEG images, each giving a different file name, but how can I move through the layers?
Thank you.
Layers of export to files would not choose the background as well as each layer layer, but this script will...
-
Export layers to files: how to keep the size of the canvas
Hello
I need to export hundreds of layers of PNG files.
Unfortunately, the Script cultures on the edge of the layer for each file has different dimensions. How to keep the size of the canvas of the PSD in the exported files?
Thanks for your help
PS-Version: MacOS, CS 5.1
trim to untick if this does not work then
http://www.filesresidence.com/file/acf00llbo09pg# , try this version it can do what you want.
-
When I run the export layers to script files in order to save my layers as png, it automatically changes the files at 72 dpi. I need to stay at 300 dpi, as in the original file. Someone can help me, how can I change the script to do this? Thanks in advance!
It uses a scriptlistner version of save for web to png8 and png24. To change the png24 so that it uses a normal backup and retains the dpi find this line of code "case png24Index:"it should be on line 840. " Comment everything between this line and "pause:", on line 890. Then add the following lines.
pngSaveOptions = new PNGSaveOptions();
pngSaveOptions.interlaced = dlgMain.pnlFileType.pnlOptions.grpPNG24Options.png24Inter.value;
app.activeDocument.saveAs (new file (exportInfo.destination + ' / ' + fileNameBody + '.png'), pngSaveOptions, true, Extension.LOWERCASE);I have not tested this, you may also add controls for 8-bit, none of the extra layers, no alpha or spot channels, etc. SFW does most of the default. But using the method saveAs and copy setting to true, I think it will be ok.
-
"One-click" How do I export an image to a set of files with different resolutions .png?
Hello
How far is 'one-click' export an image to a set of files with different resolutions .png? (I need for a set of iOS app icons).
For example: export a file MyAppIcon.psd in the following:
MyAppIcon_29x29.png
MyAppIcon_57x57.png
MyAppIcon_114x114.png
MyAppIcon_512x512.png
MyAppIcon_48x48.png
MyAppIcon_72x72.png
I almost managed to do with the Actions of Photoshop, but does not know how the names of files to include the name of the original image file. In other words, the NewApp.psd file should export to NewApp_29x29.png, not MyAppIcon_29x29.png.
Thank you!
No problem, please try this...
#target photoshop app.bringToFront(); main(); function main(){ if(!documents.length) return; var Name = app.activeDocument.name.replace(/\.[^\.]+$/, ''); try{ var Path = activeDocument.path; }catch(e){ alert("Please save this file then re-run the script!"); return; } var strtRulerUnits = app.preferences.rulerUnits; var strtTypeUnits = app.preferences.typeUnits; app.preferences.rulerUnits = Units.PIXELS; snapShot(); var saveFile = File(Path + "/" + Name + "_512x512.png"); activeDocument.resizeImage(512, 512, undefined, ResampleMethod.BICUBICSHARPER); SavePNG(saveFile); revertToLastSnapshot(); var saveFile = File(Path + "/" + Name + "_114x114.png"); activeDocument.resizeImage(114, 114, undefined, ResampleMethod.BICUBICSHARPER); SavePNG(saveFile); revertToLastSnapshot(); var saveFile = File(Path + "/" + Name + "_72x72.png"); activeDocument.resizeImage(72, 72, undefined, ResampleMethod.BICUBICSHARPER); SavePNG(saveFile); revertToLastSnapshot(); var saveFile = File(Path + "/" + Name + "_57x57.png"); activeDocument.resizeImage(57, 57, undefined, ResampleMethod.BICUBICSHARPER); SavePNG(saveFile); revertToLastSnapshot(); var saveFile = File(Path + "/" + Name + "_48x48.png"); activeDocument.resizeImage(48, 48, undefined, ResampleMethod.BICUBICSHARPER); SavePNG(saveFile); revertToLastSnapshot(); var saveFile = File(Path + "/" + Name + "_29x29.png"); activeDocument.resizeImage(29,29, undefined, ResampleMethod.BICUBICSHARPER); SavePNG(saveFile); app.preferences.rulerUnits = strtRulerUnits; app.activeDocument.close(SaveOptions.DONOTSAVECHANGES); } function SavePNG(saveFile){ var pngOpts = new ExportOptionsSaveForWeb; pngOpts.format = SaveDocumentType.PNG; pngOpts.PNG8 = false; pngOpts.transparency = true; pngOpts.interlaced = false; pngOpts.quality = 100; activeDocument.exportDocument(new File(saveFile),ExportType.SAVEFORWEB,pngOpts); } function snapShot() { var desc9 = new ActionDescriptor(); var ref5 = new ActionReference(); ref5.putClass( charIDToTypeID('SnpS') ); desc9.putReference( charIDToTypeID('null'), ref5 ); var ref6 = new ActionReference(); ref6.putProperty( charIDToTypeID('HstS'), charIDToTypeID('CrnH') ); desc9.putReference( charIDToTypeID('From'), ref6 ); desc9.putEnumerated( charIDToTypeID('Usng'), charIDToTypeID('HstS'), charIDToTypeID('FllD') ); executeAction( charIDToTypeID('Mk '), desc9, DialogModes.NO ); }; function revertToLastSnapshot() { var doc = app.activeDocument; var hsObj = doc.historyStates; var hsLength = hsObj.length; for (var i=hsLength - 1;i>-1;i--) { if (hsObj[i].snapshot) { doc.activeHistoryState = doc.historyStates.getByName('Snapshot ' + i); break; } } };
-
looking for how to export layers to file
In 2014 CC and below there is a script called export layers to files.
It was a quick way to all layers in an export for the web file.
I'm on CC 2015 and that you want to use this script, but I can't.
Is always available and hidden somewhere? Is tehre a better script for this that people have turned to?
Thank you
Hey johnc,
It has been moved under export on the file menu.
Concerning
Sarika
-
Can I export layers PSD PSD files as I could do in ImageReady 2?
Hi people,
I've been chasing this layer of export Nirvana for a couple of years now, but I got nowhere.
In ImageReady 2 I could import a PSD file and export layers with exactly the name that I used for each layer (with no annotations, prefixes or suffixes), with the size of entire file (not cropped at the edge of the image) to the PSD format.
The script in Photoshop adds locate file name that I don't see how to disable.
I tried a few free (SciptsRus) and commercials (Ferry) but they don't seem to work with my version of Photoshop (Mac OS X 10.7.4 of CS5). Is it a result the recent updates to Javascript with Mac OS X 10.7? I'll contact the authors of these scripts then and see what they say.
I tried a program called PC layer Super which exports to the PNG files and was almost what I wanted except that it cropped to the size of the file to the size of the image. I could get away with it I guess that if I copied a single pixel of 1% in each corner of the file, but it would be a lot of time for all layers, I need to export (500-600) and means I have rasterized text layers, which is also double treatment.
I even tried Graphic Converter on a Mac, but cannot get this to work completely. I find myself with strong white funds and without transparency.
All I want is to open a PSD (preferably on Mac OS) file and export each layer at the same size on a transparent background with just the name of the layer as name of file as a PSD file. I'm alos agree. PNG format, so as long as I get transparency and full file size. Just as we do with effeiciency brilliant with ImageReady CS2. I actually kept an old version of ImageRady on my PC for this, but surely in the 21st century, there is a way around this?
Many thanks in anticipation for any help offered.
Sorry to hear that you have problems with some of the scripts. Normally, it's because of the corrupt becoming prefferences. They can be trashed to see if all the, then works...
http://forums.Adobe.com/thread/375776
I have also written a new script yesterday that includes layers of settings if exist it, so that may work for you?
http://www.scriptsrus.TalkTalk.NET/LSA.htm
It will be useful.
-
How to extract the layers form a PDF (previously built with Amnesty International)
Hello
Unfortunately, I saved a whole website in PDF format design without checking "editable possibility."
= > OopsWhen open my file pdf, illustrator ask me to choose only a single page.
I thought that I would never be able to change as long as when I click on the Visual, nothing happened
but I realized that I could still isolate group
and then isolate layer, then finally an object.
I would like to leave this 'clip' mode and get back to my good old layers
Is this possible?
2 questions
How could export all these layers 'merged' into good layer, to be able to change my big file?How can I export my pdf into a good .ai file again?
Is this possible?Thank you very much
Marguerite
You can release the clipping mask, but will give you all the layers back automatically. Some objects and the effects could also be extended.
You should always save the file TO fully editable character.
From the PDF file, you can only manually things sort in a layer structure
-
How to batch, fusion of the 3 different images? I use molten and the total of 240 different images.
is there any script for it?like photoshop, batch processing is unable to identify 3 different images and merge these three images. Instead, it performs the action on a single image.
Thank you
under the direction
// 2015, use it at your own risk; #target photoshop var theFolder = Folder.selectDialog ("select folder"); if (theFolder) { //////////////////////////////////// var theFolders = theFolder.getFiles(getFolders); for (var a = 0; a < theFolders.length; a++) { var theFiles = Folder(theFolders[a]).getFiles(/\.(jpg|tif|eps|psd)$/i); //////////////////////////////////// // open first image; theFile = app.open(theFiles[0]); var basename = theFile.name.match(/(.*)\.[^\.]+$/)[1]; // place other files; for (var m = 1; m < theFiles.length; m++) { placeScaleRotateFile (theFiles[m], 0, 0, 100, 100, 0, false); // set to screen; theFile.activeLayer.blendMode = BlendMode.SCREEN }; // save as psd; psdOpts = new PhotoshopSaveOptions(); psdOpts.embedColorProfile = true; psdOpts.alphaChannels = true; psdOpts.layers = true; psdOpts.spotColors = true; theFile.saveAs((new File(theFolder+'/'+basename+".psd")),psdOpts,false); }; }; //////////////////////////////////// ////// place ////// function placeScaleRotateFile (file, xOffset, yOffset, theXScale, theYScale, theAngle, linked) { // ======================================================= var idPlc = charIDToTypeID( "Plc " ); var desc5 = new ActionDescriptor(); var idnull = charIDToTypeID( "null" ); desc5.putPath( idnull, new File( file ) ); var idFTcs = charIDToTypeID( "FTcs" ); var idQCSt = charIDToTypeID( "QCSt" ); var idQcsa = charIDToTypeID( "Qcsa" ); desc5.putEnumerated( idFTcs, idQCSt, idQcsa ); var idOfst = charIDToTypeID( "Ofst" ); var desc6 = new ActionDescriptor(); var idHrzn = charIDToTypeID( "Hrzn" ); var idPxl = charIDToTypeID( "#Pxl" ); desc6.putUnitDouble( idHrzn, idPxl, xOffset ); var idVrtc = charIDToTypeID( "Vrtc" ); var idPxl = charIDToTypeID( "#Pxl" ); desc6.putUnitDouble( idVrtc, idPxl, yOffset ); var idOfst = charIDToTypeID( "Ofst" ); desc5.putObject( idOfst, idOfst, desc6 ); var idWdth = charIDToTypeID( "Wdth" ); var idPrc = charIDToTypeID( "#Prc" ); desc5.putUnitDouble( idWdth, idPrc, theYScale ); var idHght = charIDToTypeID( "Hght" ); var idPrc = charIDToTypeID( "#Prc" ); desc5.putUnitDouble( idHght, idPrc, theXScale ); var idAngl = charIDToTypeID( "Angl" ); var idAng = charIDToTypeID( "#Ang" ); desc5.putUnitDouble( idAngl, idAng,theAngle ); if (linked == true) { var idLnkd = charIDToTypeID( "Lnkd" ); desc5.putBoolean( idLnkd, true ); }; executeAction( idPlc, desc5, DialogModes.NO ); // get layerid; var ref = new ActionReference(); ref.putProperty (stringIDToTypeID ("property"), stringIDToTypeID ("layerID")); ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") ); var layerDesc = executeActionGet(ref); var layerID = layerDesc.getInteger (stringIDToTypeID ("layerID")); // ======================================================= return [app.activeDocument.activeLayer, layerID]; }; ////// get folders ////// function getFolders (theObj) { if (theObj.constructor == Folder) {return true} };
-
How make/quick export in Adobe after effects CC
Hello
How can I export and make fast in Adobe After Effects, I bought a new PC, but it is not fast enough in my opinion.
I want to export a project of 60 fps for 1920 * 1080, 10 seconds long. It takes a very long time.
I've already put my GPU as CPU, but if I start rendering and look my GPU usage, After Effects will not use it.
Screenshots of my project and settings:
Project - https://snapr.pw/i/b18473e4cc.png
Momory - https://snapr.pw/i/e92cb228a9.png
Cache - https://snapr.pw/i/30addc6d0c.png
GPU - https://snapr.pw/i/2b36b10748.png
Computer system: popoqwerty - Profiel - started
CPU - Intel Core i7 - 8520K six hearts
GPU - Asus GTX OC 780 6 GB STRIX
Motherboard - Asus X 99-A
RAM - Crucial 16 GB
SSD - Samsung SSD PRO 850
HARD - WD Black 2 TB drive
> How can I export and make fast in Adobe After Effects.
See this page for resources to make After Effects work faster: http://adobe.ly/eV2zE7
> I already have my GPU as CPU, but if I start rendering and look my GPU usage, After Effects will not use it.
After Effects uses the GPU to almost nothing. See this page for details of the GPU features in After Effects:
Features GPU (CUDA, OpenGL) in After Effects
> "Verry long" is 10 minutes for a 10 second video.
10 minutes is not a long time for a 10 second with Visual effects, compositing, 3D movie or many other types of treatment by high-performance computing. Often, people leave films of 30 seconds during the night or on the weekend to return. This is true for all the aoftware who does this kind of work, not only After Effects.
Maybe you are looking for
-
driver DVD update and there but does not work
My HP laptop DVD player does not work properly. When I try to update the driver, it does state that it is updated and currently, but it will not allow the DVD player function. When I check the peripheral material, it gives an error CODE 19. It says
-
Recharge with an iPhone/iPad car charger only
I have a Honda CRV from 2015. Suddenly, none of our iPhones will load with car chargers. Two different Chargers, two different ports, lights, showing the power to the cables on the two, previously worked. Our iPhones include a 6Plus, 6 and 5. I
-
C6350, install error - driver problem?
Hi all RAN into this error while installing drivers for my C6350. I have had this printer for some time, it comes first in the management of problems during installation. Alos tried repeatedly, defraged and tried again, but still does not. I have obv
-
I have a 64-bit system, but my CD ROM is a 32-bit, so does not open? What can l
-
c:\windows\uyepozan.dll error message
Can you help me with system restore. I tried to find the file but couldn't. In my view, it can be entered the Trojan horse, but not sure?