Photoshop Script: Export Layer To File

Hi
I have set up an action to  use "Export Layer To Files" to save out  multipile jpg, and I have noticed the file compression is allot larger compared to the, Save for web option. Is there anyway I can use Export Layer To Files in an action, but then use the Save for web option to get better compression for the final file export?

The "Export Layer To Files"  script seems to be a plugin script therefore it records the setting use in it dialog into an action step when recorded into an action. Thus when the action is played the "Export Layer To Files" script step  will bypass displaying its "Export Layer To Files" dialog and use the setting it recorded into your action step. So you must have selected save jpeg and set a high quality jpeg setting in its dialog when you recorded the action. If you re-record the action step and uncheck include ICC profile and set a low jpeg quality setting.  The jpeg files saved will be smaller in the future.   The Jpeg quality setting influences how  compression is done.  Low quality setting loose more image quality than high settings but the output file size is smaller with lower values. Save for web you can reduce output size also by saving lower quality image additionally you can also strip all image meta-data and reduce the  image size using interpolation.

Similar Messages

  • Scripts / Export Layers to Files / Include Background Layer

    Running the script Export Layers to files.
    Need to keep one layer on that is applied to all the layers (I have a stroke on the top layer I would like applied to all the images that are saved out.)
    How do I modify the script for this?
    Thanks!
    Ken

    Adapting that Script might be somewhat difficult as it is pretty bulky.
    But if its always the topmost layer thats supposed to stay visible and You know which format You want to save the resulting files to beforehand something much smaller may suffice.
    You might try this, but I havent tested it extensively:
    #target photoshop;
    var myDocument = app.activeDocument;
    // get the name and location;
    var docName = myDocument.name;
    var basename = docName.match(/(.*)\.[^\.]+$/)[1];
    var docPath = myDocument.path;
    // get the artlayers and remove the topmost;
    var allArtLayers = collectLayers(myDocument);
    var theTopmost = allArtLayers.pop();
    // hide all but the topmost layer;
    for (var n = 0; n < allArtLayers.length; n++ ) {
       allArtLayers[n].visible = false
    for (var m = 0; m < allArtLayers.length; m++ ) {
    // show the layer;
       allArtLayers[m].visible = true;
    // tiff options;
       tifOpts = new TiffSaveOptions();
       tifOpts.embedColorProfile = true;
       tifOpts.imageCompression = TIFFEncoding.TIFFLZW;
       tifOpts.alphaChannels = false;
       tifOpts.byteOrder = ByteOrder.MACOS ;
       tifOpts.layers = true;
    // duplicate the image;
       var thecopy = myDocument.duplicate (thecopy, true);
    // save copy;
       thecopy.saveAs((new File(docPath+"/"+basename+" "+allArtLayers[m].name+".tif")),tifOpts,true);
       thecopy.close(SaveOptions.DONOTSAVECHANGES);
    // hide the layer again;
       allArtLayers[m].visible = false
    //thats it; thanks to xbytor;
    ////// collect all artlayers //////
    function collectLayers (theParent) {
       if (!allArtLayers) {
          var allArtLayers = new Array}
       else {};
       for (var m = theParent.layers.length - 1; m >= 0;m--) {
          var theLayer = theParent.layers[m];
    // apply the funtion to layersets;
          if (theLayer.constructor == ArtLayer) {
             allArtLayers = allArtLayers.concat(theLayer)
          else {
             allArtLayers = allArtLayers.concat(collectLayers(theLayer))
       return allArtLayers

  • How can I get the script Export Layers to Files to export compressed pngs?

    I would love to be able to take advantage of Photoshop's compressed png when using the script Export Layers to Files. I there a way I could modify the script to do this?
    TIA!!!
    ========================
    I found it ... I needed to add a line to the pngSaveOptions (around line #886) ...
                var saveFile = new File(exportInfo.destination + "/" + fileNameBody + ".png");
                pngSaveOptions = new PNGSaveOptions();
                pngSaveOptions.interlaced = false;
                // trying to compress png files
                pngSaveOptions.compression = 9;
                docRef.saveAs(saveFile, pngSaveOptions, true, Extension.LOWERCASE);
                break;
    =========================

    It does. The standalone XML Export was only offered by itself
    in the
    registration incentives. Sorry.
    Nancy Gill
    Adobe Community Expert
    Author: Dreamweaver 8 e-book for the DMX Zone
    Co-Author: Dreamweaver MX: Instant Troubleshooter (August,
    2003)
    Technical Editor: DMX 2004: The Complete Reference, DMX 2004:
    A Beginner''s
    Guide, Mastering Macromedia Contribute
    Technical Reviewer: Dynamic Dreamweaver MX/DMX: Advanced PHP
    Web Development
    "neilcreagh" <[email protected]> wrote in
    message
    news:f4rsrt$ptf$[email protected]..
    > I've just purchased Dreamweaver CS3 and, after
    registering, the email sent
    > offered me a free gift. I chose the free font. Another
    option is the
    > Dreamweaver XML Export Extension for Spry and I would
    like to purchase
    > this (it
    > stated the value at ?15) but I can't find it anywhere?
    >
    > The interaktonline website says that its functionality
    has been included
    > in
    > the Dreamweaver Developer Toolbox - but does this mean
    that I have to
    > purchase
    > the entire toolbox?
    >

  • Photoshop scripting, export to png?

    I use the following code:
    function SavePNG(saveFile){
      var opts = new ExportOptionsSaveForWeb();
      opts.format = SaveDocumentType.PNG;
      opts.PNGB = true;
      opts.quality = 100;
      pngFile = new File(saveFile);
      opts.includeProfile = true;
      app.activeDocument.exportDocument(pngFile, ExportType.SAVEFORWEB, opts);
    It almost workable, but it works with fully visible or fully invisible areas only. For example if I have a transparent layer and add a second transparent layer with a red rect with opacity 50%, then I will got an image where the transparency of this rect is 100% (fully visible).
    How to solve this problem? I use Photoshop CS6 (Mac OS version).

    In ESTK check out Help > Object Model Viewer, select Photoshop and look up »ExportOptionsSaveForWeb«.
    Also you should be able to find examples in the Photoshop Scripting Forum.

  • Photoshop CS5 export layer comps bug / issue

    I'm experiencing a problem with CS5 that didn't happen in CS4. For some weird reason, when I use the export layer comps script, it won't let me choose a destination for the jpgs that is the macintosh HD. It will only work if I export to an external drive. The error message I get is 'destination does not exist'
    I am on snow leopard and have repaired my permissions. For now I get around the problem by exporting to an external drive, but this seems like a weird issue.
    Any ideas?
    Thanks,
    Tom

    my setup is very easy,
    go > connect to server
    choose the SMB share > connect
    select the volumes that you want...
    I had mounted the volume by placing it into my login startup but since the problem with PS I have removed this ( the good news is that this is how I was able to find this bug). Either way, via the login startup item or the method above creates the problem.
    If you follow the link below to locate the user "speeves1" he has much more insight into the Windows thing than I do, I'm just a rule follower when it comes to networking windows computers.
    http://forums.adobe.com/message/3104027#3104027
    > I can't share specifics of what we have planned, but we are looking into these issues.
    I understand you can't announce future things, no problem. Because of an earlier conversation about Adobe restricted to adding new features after the first quarter of a release, I was curious if the same rulings committee (FASB) has any guidelines for bug fixes. CS4 had one fix within the first quarter and the second patch came after the product cycle ended and CS5 shipped. In general is there any restriction to releasing patches/fixes after the first quarter?
    thanks.

  • PS CC: export layer to files without prefix / numbers

    Hi,
    Trying to modify the script in Photoshop CC for the "layers to file" option in order to remove the number-prefix, I just got erorrs.
    Has anyone a working solution for removing the numbers while exporting?
    Thanks.
    Julia

    Oh, I`ve got the solution:
    Start line 1020:
    var fileNameBody = fileNamePrefix;
            //fileNameBody += "_" + zeroSuppress(i, 4);  (change this line into a comment)
            if(fileNameBody != '') fileNameBody += "_";   (make an if-statement for the case you give the file a perfix, it will add automatically an underscore)
            fileNameBody += layerName;                         (say that the file name is the layer name)
    done

  • Report script export 0 KB file from BSO application

    HI, I am try to export budget data from classic planning application using report script in essbase. Report script is not giving any erros. After successful execution it is creating 0kb file. I am able to export data for the same combination using Calculation script. But, report script is not giving any output. I need to export data using report script only. Can any one help on this.

    Can you post the calculation script too?
    {SUPMISSINGROWS}
    <PAGE(SCENARIO,VERSION,CURRENCY,YEAR,CUSTOME3)
    BUDGET FINAL Local FY13
    <ROW(ENTITY,ACCOUNT,CUSTOME1,CUSTOME2,PERIOD)
    <LINK(IDESCENDANTS(ENTITY) AND <LEV(ENTITY,0))
    <LINK(IDESCENDANTS(ACCOUNT) AND <LEV(Account,0))
    <LINK(IDESCENDANTS(CUSTOME1) AND <LEV(CUSTOME1,0))
    <LINK(IDESCENDANTS(CUSTOME2) AND <LEV(CUSTOME2,0))
    JUL
    <COLUMN(HSP_RATES)
    HSP_INPUTVALUE
    Why do you want to use LINK if you are pulling all level 0 <LEV will do the trick, unless you are targeting a specific parent other than the root.
    Regards
    Celvin

  • Photoshop CC export layers to files without prefix

    Can anyone help with this?

    Maybe you should ask over at
    http://forums.adobe.com/community/photoshop/photoshop_scripting?view=discussions

  • Export layers to file script error in Photoshop CC

    I need help with an issue.  I also asked this in the general forum but was refered here to ask all of you amazingly talented scripting geniuses.
    My issue is with the Export Layers script that comes installed with Photoshop.  I am running Windows 7 64bit - using photoshop version: creative cloud 64bit.
    When i try to run File>Scripts> Export Layers to files I get this error
    Error 22: Windows does not have a constructor. Line: 239 -> dlgMain = new Window ("dialog", strTitle); 
    When i load Photoshop Creative Cloud 32 bit i get a different error message when trying to run the script. 
    Error - 33: Internal error . line:395 ->  dligMain.pnlFileType.pnlOptions.grpJPGOptions = ...
    I can't run the image processor script I also get an error with that. 
    This  is an issue for me as i use this script on a daily basis.  It worked in PSCS6  
    I upgraded, i dont' want to have to load an older  version of photoshop to do this task  
    Thanks
    Carrie 

    I'm afraid no ideas...
    These kind of errors appeared to me too (Mac, CS5/CS6). If memory doesn't fail me - and there were tricks to be applied in your own scripts to workaround the problem - the issue was due to a stack of commands involving Document change (say: switch from document A to document B and then activate the layer X): what happened was that the script's call "activate the layer X" was too quick - i.e. it happened before Photoshop could actually perform the switch. As a result the "activate the Layer X" was executed on the A document instead of the B document and the whole thing broke.
    Mind you, it's just an example I've made up.
    Tab view for some reason worked as expected.
    I would suggest to try with no other documents open, resetting the preferences (launch PS pressing CRTL+ALT+SHIFT) - but this is quite generic, as a recommendation.
    Davide

  • CS5 Photoshop Scripts Error: Export Layers to Files...

    Hey Folks,
    I'm banging my head against the wall trying to figure out why I can't use the script: Export Layers to Files...
    I am recieving this error messages in my attempt:
    I have ran the Adobe updater and made sure everything is current.
    I restarted my magic toster twice after the update.
    I even tried a basic psd with 2 layers in an effort to determine if it was the working psd file itself... No luck.
    So I am convinced now that there may be a bug.
    Does anyone have any insight or workarounds for this solution?
    Thank you all in advance.
    John

    Jeffrey,
    Thanks for your response.
    It's the original script that shipped stock with CS5.
    Get this...
    I switched from 32 bit mode back into 64 and restarted the program.
    Opened my psd and tried again...
    No error this time, but this is what I get:
    Nothing!
    So racked on this one dude...

  • Weird numbers when Exporting Layers to Files / Layer Comps to Files

    Hi there,
    File > Scripts > Export Layers to Files ...
    File > Scripts >  Layer Comps to Files ...
    File > Scripts >  Layer Comps to PDF ...
    File > Scripts >  Layer Comps to WPG ...
    After I use each of these Scripts , even if I specify "File Name Prefix:", in the name of the exported files I see strange nomeration. This is pretty confusing , because each time I have to rename the files to remove these numbers.
    Adobe please remove the numbers prefix that these Scipts adds..
    Thanks!
    Regards,
    SK

    Hi. You’ve posted your question in a forum that is for beginners trying to learn the basics of Photoshop.  I'm moving your question to the Photoshop General Discussion forum for specialized attention to your situation.

  • Export Layers To Files - Renaming Script PS CC

    On all previous versions of Photoshop, including CS6 (before the recent update to PS CC), I was able to use the ExtendScript Toolkit to edit the PS preset script that adds naming/numbering sequences to files when running the "Export Layers to Files" script. For PS CS 6, I edited the script to remove the automatic naming/numbering of exported layers by editing the following in ExtendScript Toolkit:
    In ExtendScript Toolkit CS6 open the Export Layers to Files.jsx (applications/adobe photoshop cs6/presets/scripts/export layers to files.jsx)
    on line 1030:
    change:
    fileNameBody += "_" + zeroSuppress(i, 4);
    to:
    //fileNameBody += "_" + zeroSuppress(i, 4);
    on line 1031:
    change:
    fileNameBody += "_" + layerName;
    to:
    fileNameBody += "" + layerName;
    This solved my problem and allowed PS to export my layers to files, keeping the layer name as the filename without adding any naming or numbering sequences to the filename. However with the recent release of Photoshop CC, the script change above does not work. It looks as though there are some new lines of scripting with Photoshop CC and I would love to know what else I need to change to prevent PS CC from renaming files when using the Export Layers to File script. Without the ability to change this, I will have to go through numerous steps in bath rename in Bridge, which when working with 100's of files with different naming structures would totally slow down my workflow. Any ideas on what to update in the Photoshop CC Script to fix this? Thanks so very much!

    Welcome to the forum.
    You would maybe be better served asking in the PhotoShop Scripting Forum
    http://forums.adobe.com/community/photoshop/photoshop_scripting
    Or even here:
    http://www.ps-scripts.com/bb/index.php
    In general, I think there were changes across the board with the scripting in CC that broke things in PS, IL, ID, etc. I have seen it in both the Illustrator and InDesign scripting forums, previous scripts no longer work as before or are broken, features removed, etc. Sad but true.

  • I need to create an action or script to save the file with the name of the selected layer

    I need to create an action or script to save the file with the name of the selected layer (not including the hidden layers, but including those visible).
    How could modify the script: 'Layer Comps To Files.jsx' to get the result?
    Warning: I do not need to export all layers as files.
    Who can help me?
    THX in advance

    Versione in Italiano (Further down the English version)
    NB - Nella versione inglese ho messo tutte le immagini dei menu in italiano.
    Versione per Mac, ma credo sia identico per Windows.
    Spiego passo passo cosa ho fatto:
    - Ho creato un file esempio con tre Livelli, salvato sulla scrivania e ho chiuso il file.
    - Ho aperto il file e selezionato il Livello al centro per iniziare a registrare una azione che ho chiamato: Save with Name of Selected Layer
    - Nuova azione
    - Dare il nome e premere Registra
    Ora salva…
    - Menu --> Livello --> Nuovo --> Livello... e premi -ok-, (lascia il nome che viene mostrato)
    - Ancora una volta Menu --> Livello... --> Nuovo --> Livello... e premi -ok-, (lascia il nome che viene mostrato)
    - Menu --> Livello --> Ordina --> Dietro
    - Menu --> Livello --> Unisci sotto
    - Menu --> Livello --> Unisci visibili
    - Menu --> Livello --> Nuovo --> Livello... e premi -ok-, (lascia il nome che viene mostrato)
    - Menu --> Livello - Nascondi Livello
    - Menu --> Elimina --> Elimina livelli nascosti (press -Yes-)
    - Menu --> Livello --> Nuovo --> Livello... Inserisci questo: 'Move this to the trash' e premi ok
    - Menu --> File --> Script --> Esporta Livelli in File... (Nella finestra che si apre scegliere l’opzione che si desidera, ma togliere il prefisso del nome) e premere -Esegui-
    - Selezionare il pannello Storia cliccare su Elimina premendo -Si- ogni volta che si apre la finestra di dialogo (Ripetere 8 volte questa operazione sino ad arrivare nella storia alla condizione di partenza. Ho visto che è meglio di Ripristina -F12-)
    - Fermare la registrazione.
    A questo punto, mandando in esecuzione questa Azione, ho raggiunto parzialmente l’obiettivo perché i file così creati mantengono, purtroppo, dei prefissi numerici per evitare probabilmente la sovrascrizione di file (credo senza avviso) nel posto dove vengono creati.
    Per ottenere l’obiettivo occorre un nuovo passo ed a proposito di questo riferisco quanto segue:
    ATTENZIONE - L’operazione descritta qui di seguito deve essere fatta su di una copia del file, per cui:
    - Duplicare il file,
    - Spostare l’originale in altra cartella
    - Lavorare sul file duplicato.
    mi riferisco a questo...
    ATTENZIONE - Questa modifica è effettuata a proprio rischio e pericolo ed il sottoscritto non si assume alcuna responsabilità su quanto venga fatto soprattutto da mani inesperte.
    ATTENZIONE - Questa modifica sovrascrive qualsiasi file che abbia nome uguale al layer che viene selezionato più l’estensione del file naturalmente.
    Comunque la modifica è banalissima e a portata di chiunque.
    Procedere così:
    - Chiudere Photoshop
    - Aprire (nel percorso specificato dall’immagine) il file “Export Layers to Files.jsx” (Export Layers To Files.jsx 1.0.0.16) con un editor di testo puro.
    - cercare la stringa (dovrebbe essere in riga 1029)
    var fileNameBody = fileNamePrefix;
    fileNameBody += "_" + zeroSuppress(i, 4);
    fileNameBody += "_" + layerName;
    - sostituirla con:
    var fileNameBody = fileNamePrefix;
    fileNameBody += layerName;
    - cercare la stringa (dovrebbe essere in riga 1047-46)
    var fileNameBody = fileNamePrefix;
    fileNameBody += "_" + zeroSuppress(i, 4) + "s";
    - sostituirla con:
    var fileNameBody = fileNamePrefix;
    fileNameBody += "";
    - salvare e uscire.
    - riavviare Photoshop
    - provare l’azione registrata facendo attenzione che il nome del layer non sia identico al nome di un file già presente altrimenti questo verrà sovrascritto.
    Domanda:
    Perché ho creato livelli che poi ho eliminato ecc.
    Risposta:
    Semplice per evitare errori di esecuzione delle azioni nel caso di operazioni con livelli mancanti o altro.
    Semplice... no?
    English version
    Mac version, but I think it's the same for Windows.
    First of all, I'm translating the actions that I made using the Italian version of Photoshop, you look at the position of the menu that I have chosen to do the work with other languages.
    I explain step by step what I did:
    - I created a sample file with three layers, saved to the desktop and I closed the file.
    - I opened the file and select the layer at the center to start recording an action that I called: Save with Name of the Selected Layer
    - New action
    - Give the name and press Save ( I think it is so in English )
    Now save ...
    - Menu -> Layer - > New —> Layer… and press -ok- , (leave the name that is shown)
    - Once again Menu -> Layer - > New —> Layer… and press -ok- , (leave the name that is shown)
    - Menu -> Layer - > Arrange (order) -> Behind
    - Menu -> Layer - > Merge Down
    - Menu -> Layer - > Merge Visible
    - Menu -> Layer - > New —> Layer… and press -ok- , (leave the name that is shown)
    - Menu -> Layer - Hide Layer
    - Menu - > Delete - > Delete hidden layers (press -Yes- )
    - Menu -> Layer - > New —> Layer… Enter this: ' Move this to the trash ' and press ok
    - Menu -> File - > Scripts -> Export Layers To Files... (In the window that opens select the option you want, but take away the name prefix) and press - Run -
    - Select the History panel and click Delete (on menu opened) pressing -Yes- every time when open the dialog box (8 times Repeat this step until you get into the story to the starting condition. Not use Restore -F12-).
    - Stop recording.
    At this point, by executing this action, I have reached the goal partly because the files created in this way remain, unfortunately, the numerical prefixes to avoid possibly overwriting of files (I think without notice) in the place where they are created.
    To achieve the goal we need a new step and thinking about this as follows:
    WARNING - The operation described below should be made on a copy of the file, so :
    - Duplicate the file
    - Move the original folder to another
    - Work on the duplicate file.
    WARNING - This modification is performed at your own risk and the undersigned assumes no responsibility on what is done mostly by inexperienced hands.
    WARNING - This change will overwrite any files with the same name as the selected layer plus the file extension of course.
    However, the change is trivial and within reach of anyone.
    Proceed as follows:
    - Close Photoshop
    - Open (in the specified path from the image ) file " Export Layers to Files.jsx " (Export Layers To Files.jsx 1.0.0.16) with a pure text editor.
    - Search for the string (should be in line 1029 )
    var = fileNameBody fileNamePrefix ;
    fileNameBody = + "_" + zeroSuppress (i, 4 ) ;
    fileNameBody + = "_ " + layerName ;
    - Replace it with :
    var = fileNameBody fileNamePrefix ;
    fileNameBody + = layerName ;
    - Search for the string (should be in line 1047-46 )
    var = fileNameBody fileNamePrefix ;
    fileNameBody + = "_ " + zeroSuppress (i, 4) + "s" ;
    - Replace it with :
    var = fileNameBody fileNamePrefix ;
    fileNameBody + = "";
    - Save and exit.
    - Restart Photoshop
    - Try the recorded Action, making sure that the layer name is not identical to the name of an existing file otherwise it will be overwritten.
    Question:
    Why I created levels which I then deleted etc..
    Answer:
    Simple to avoid errors of execution of the actions in the case of transactions with missing levels and other.
    Simple ... is not it?
    Sorry for my bad English...
    Thanks in advance for any hint.
    --->>> Please think about this... Adobe <<<---

  • How to export a PSD file with layers to Fireworks PNG file.

    Hi
    I've been asked by someone I'm working for to supply the work I've done as a PNG file that can be edited. I was told that a layered PSD file can be converted to a layered fireworks PNG file. I've tried all sorts of things but either ended up with a flattened image or each layer as a seperate file. I've searched all over for answers but nothing as yet!
    thanks

    Yes, individual PNG-24 files from Photoshop is what you want. In Photoshop, File>Scripts>Export Layers to Files; browse to save location; choose PNG-24 as the file type; check transparency. Prior to this, if you have floating imagery in any layers in the Photoshop file, you will want to place 1-pixel dots in 2 opposing image corners on those layers, so the all layer sizes will be exported at the same size, for layer-registration when composed in Fireworks. Then delete those dots in the exported PNG files and resave.
    Then you will need to compose the layers in Fireworks. Once you get your individual layers in PNG format, you might want to pose this question in the Fireworks forum.

  • How batch export layers to files in CS5

    Hi,
    I am a newbie in CS5 , I tried to batch export layer to files in CS5 , because I have thousands  PSD files that I need to export layers in  separated png files..
    In each script I made I have the following error.." reference error: dlgMain is not found" ( in french: erreur de reference: dlgMain n'est pas definie)
    How  can I batch export layers to files in CS5??
    Thankyou all by advance for your help.

    I am humbled to be of any help. I truly believe you are one of the unsung heroes of the Photoshop community!
    I lost track of how many custom and ingenious scripts you created for countless other users, in so many online places...
    As a scripts Illiterate, I bow in front of your knowledge and generosity!
    (But Learning After Effects Expressions might in fact made me begin to make tiny steps towards wrapping my head around scripting)

Maybe you are looking for