Highlighted

Record Action containing an Export "Layer to Files" but with different file names for Batch purposes

New Here ,
Aug 16, 2020

Copy link to clipboard

Copied

I'm trying to run a batch that uses an action to Export "Layers to files". I'm not writing my own script because I don't know how. 

 

The files keep overwriting so that the batch is pointless. How can I get the export action to simply use the file's own name as the prefix?

 

It's auto-populating when I'm recording the action, but that's the prefix it gives ALL the files processed with that action. 

 

There's no way Adobe missed this issue, what am I missing?

TOPICS
Actions and scripting, Import and export

Views

77

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Record Action containing an Export "Layer to Files" but with different file names for Batch purposes

New Here ,
Aug 16, 2020

Copy link to clipboard

Copied

I'm trying to run a batch that uses an action to Export "Layers to files". I'm not writing my own script because I don't know how. 

 

The files keep overwriting so that the batch is pointless. How can I get the export action to simply use the file's own name as the prefix?

 

It's auto-populating when I'm recording the action, but that's the prefix it gives ALL the files processed with that action. 

 

There's no way Adobe missed this issue, what am I missing?

TOPICS
Actions and scripting, Import and export

Views

78

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Aug 16, 2020 0
Most Valuable Participant ,
Aug 16, 2020

Copy link to clipboard

Copied

No you just do not understand that is how plug-ins work when you record them in actions they record the setting you set recording the action step in their dialog into the Action step and they bypass displaying their dialog when the action step is played and use the settings pass by the action. You recorded the prefix, the destination, the file type etc into the action step. If you want to change these the step must be made interactive by turning on the steps dialog.  If you batch that action it would be an interactive process not an actual batch process because user interaction is required.   You mat be able to write a script that would dynamically pass the the setting you want the plug-in to use.  If an action can pass the dialogs settings to the plug-in script a script could pass the setting as well.. The Script can find the information about the active document,  You would be able to use that document's name as the prefix. You will need to supply the other settings as well. Where to save the file type to save and the file type save options. Like the Message in the Action step.

image.png

JJMack

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 16, 2020 0
JJMack LATEST
Most Valuable Participant ,
Aug 16, 2020

Copy link to clipboard

Copied

I use Adobe ScriptListener plug-in to record export Layers to files for a clipboard document have the files saved to my desktop folder Images with prefix clipboard file type jpeg include icc quality 10. 

image.png

Here is is the Action manager code recorded by  Adobe Plug-in.   Export Layers to Files UUID is "6f1c2cf5-4a97-4e32-8f59-f5d7a087adef"

 

// =======================================================
var idsixfonectwocffivefouraninesevenfourethreetwoeightffivenineffivedsevenazeroeightsevenadef = stringIDToTypeID( "6f1c2cf5-4a97-4e32-8f59-f5d7a087adef" );
    var desc449 = new ActionDescriptor();
    var idMsge = charIDToTypeID( "Msge" );
    desc449.putString( idMsge, """Export Layers To Files action settings""" );
    var iddestination = stringIDToTypeID( "destination" );
    desc449.putString( iddestination, """C:\Users\jjmac\Desktop\Images""" );
    var idfileNamePrefix = stringIDToTypeID( "fileNamePrefix" );
    desc449.putString( idfileNamePrefix, """Clipboard""" );
    var idvisibleOnly = stringIDToTypeID( "visibleOnly" );
    desc449.putBoolean( idvisibleOnly, false );
    var idFlTy = charIDToTypeID( "FlTy" );
    desc449.putDouble( idFlTy, 1.000000 );
    var idicc = stringIDToTypeID( "icc" );
    desc449.putBoolean( idicc, true );
    var idjpegQuality = stringIDToTypeID( "jpegQuality" );
    desc449.putString( idjpegQuality, """10""" );
    var idpsdMaxComp = stringIDToTypeID( "psdMaxComp" );
    desc449.putBoolean( idpsdMaxComp, true );
    var idtiffCompression = stringIDToTypeID( "tiffCompression" );
    desc449.putString( idtiffCompression, """TIFFEncoding.NONE""" );
    var idtiffJpegQuality = stringIDToTypeID( "tiffJpegQuality" );
    desc449.putString( idtiffJpegQuality, """8""" );
    var idpdfEncoding = stringIDToTypeID( "pdfEncoding" );
    desc449.putString( idpdfEncoding, """PDFEncoding.JPEG""" );
    var idpdfJpegQuality = stringIDToTypeID( "pdfJpegQuality" );
    desc449.putString( idpdfJpegQuality, """8""" );
    var idtargaDepth = stringIDToTypeID( "targaDepth" );
    desc449.putString( idtargaDepth, """TargaBitsPerPixels.TWENTYFOUR""" );
    var idbmpDepth = stringIDToTypeID( "bmpDepth" );
    desc449.putString( idbmpDepth, """BMPDepthType.TWENTYFOUR""" );
    var idpngtwofourTransparency = stringIDToTypeID( "png24Transparency" );
    desc449.putBoolean( idpngtwofourTransparency, true );
    var idpngtwofourInterlaced = stringIDToTypeID( "png24Interlaced" );
    desc449.putBoolean( idpngtwofourInterlaced, false );
    var idpngtwofourTrim = stringIDToTypeID( "png24Trim" );
    desc449.putBoolean( idpngtwofourTrim, false );
    var idpngeightTransparency = stringIDToTypeID( "png8Transparency" );
    desc449.putBoolean( idpngeightTransparency, true );
    var idpngeightInterlaced = stringIDToTypeID( "png8Interlaced" );
    desc449.putBoolean( idpngeightInterlaced, false );
    var idpngeightTrim = stringIDToTypeID( "png8Trim" );
    desc449.putBoolean( idpngeightTrim, true );
executeAction( idsixfonectwocffivefouraninesevenfourethreetwoeightffivenineffivedsevenazeroeightsevenadef, desc449, DialogModes.NO );A

 

 

The Clean SL script clean the up like this:

 

6f1c2cf54a974e328f59f5d7a087adef("Export Layers To Files action settings", "C:\Users\jjmac\Desktop\Images", "Clipboard", false, 1, true, "10", true, "TIFFEncoding.NONE", "8", "PDFEncoding.JPEG", "8", "TargaBitsPerPixels.TWENTYFOUR", "BMPDepthType.TWENTYFOUR", true, false, false, true, false, true);

function 6f1c2cf54a974e328f59f5d7a087adef(message, destination, fileNamePrefix, visibleOnly, fileType, icc, jpegQuality, psdMaxComp, tiffCompression, tiffJpegQuality, pdfEncoding, pdfJpegQuality, targaDepth, bmpDepth, png24Transparency, png24Interlaced, png24Trim, png8Transparency, png8Interlaced, png8Trim) {
	var descriptor = new ActionDescriptor();

	descriptor.putString( stringIDToTypeID( "message" ), message );
	descriptor.putString( stringIDToTypeID( "destination" ), destination );
	descriptor.putString( stringIDToTypeID( "fileNamePrefix" ), fileNamePrefix );
	descriptor.putBoolean( stringIDToTypeID( "visibleOnly" ), visibleOnly );
	descriptor.putDouble( stringIDToTypeID( "fileType" ), fileType );
	descriptor.putBoolean( stringIDToTypeID( "icc" ), icc );
	descriptor.putString( stringIDToTypeID( "jpegQuality" ), jpegQuality );
	descriptor.putBoolean( stringIDToTypeID( "psdMaxComp" ), psdMaxComp );
	descriptor.putString( stringIDToTypeID( "tiffCompression" ), tiffCompression );
	descriptor.putString( stringIDToTypeID( "tiffJpegQuality" ), tiffJpegQuality );
	descriptor.putString( stringIDToTypeID( "pdfEncoding" ), pdfEncoding );
	descriptor.putString( stringIDToTypeID( "pdfJpegQuality" ), pdfJpegQuality );
	descriptor.putString( stringIDToTypeID( "targaDepth" ), targaDepth );
	descriptor.putString( stringIDToTypeID( "bmpDepth" ), bmpDepth );
	descriptor.putBoolean( stringIDToTypeID( "png24Transparency" ), png24Transparency );
	descriptor.putBoolean( stringIDToTypeID( "png24Interlaced" ), png24Interlaced );
	descriptor.putBoolean( stringIDToTypeID( "png24Trim" ), png24Trim );
	descriptor.putBoolean( stringIDToTypeID( "png8Transparency" ), png8Transparency );
	descriptor.putBoolean( stringIDToTypeID( "png8Interlaced" ), png8Interlaced );
	descriptor.putBoolean( stringIDToTypeID( "png8Trim" ), png8Trim );
	executeAction( stringIDToTypeID( "6f1c2cf5-4a97-4e32-8f59-f5d7a087adef" ), descriptor, DialogModes.NO );
}

 

JJMack

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 16, 2020 0