Saving Adj. Layers In a Group

Hello
I am trying to create a sctipt that will save all of the adjustement layers in a group to a tiff. The group would always have the same name, somthing like "colors". I am hoping that one adj layer could be turned on, saved as a tif, the adj layer would be turned off and the next adj layer would be turned on, saved as a tif, and turned off then the next and the next etc. We would also need the name of the layer saved in the final tif file name.
If anyone has anything like this or could please help me with this, I would greatly appreciat it.
Thank you.

You really should describe what you want more exactly right away.
Could you give this a try:
// thanks to xbytor for regexp;
// 2012, use it at your own risk;
#target photoshop
if (app.documents.length > 0) {
var myDoc = app.activeDocument;
var docName = myDoc.name;
try {var basename = docName.match(/(.*)\.[^\.]+$/)[1];
var docPath = myDoc.path}
catch (e) {var basename = docName;
var docPath = "~/Desktop"};
// try to get set »colors« in »swatch worker«;
try {
var theSet = myDoc.layers.getByName("Swatch Worker").layers.getByName("colors");
for (var n = 0; n < theSet.layers.length; n++) {
theSet.layers[n].visible = false;
// process;
for (var m = 0; m < theSet.layers.length; m++) {
var thisLayer = theSet.layers[m];
thisLayer.visible = true;
var layerName = thisLayer.name;
while (layerName.indexOf("/") != -1) {layerName = layerName.replace("/", "_")};
saveFlattenedTiff (myDoc, basename + "_" + layerName, docPath)
thisLayer.visible = false;
catch (e) {alert ("can’t locate folder")};
////// function to save the flattened tiff from copy //////
function saveFlattenedTiff (myDoc, basename, docPath) {
tifOpts = new TiffSaveOptions();
tifOpts.embedColorProfile = true;
tifOpts.imageCompression = TIFFEncoding.TIFFLZW;
tifOpts.alphaChannels = false;
tifOpts.byteOrder = ByteOrder.MACOS;
tifOpts.layers = false;
myDoc.saveAs((new File(docPath+"/"+basename+".tif")),tifOpts,true)

Similar Messages

  • Clipped adjustment layers behave differently when blend clipped layers as a group is selected. Why?

    Let's say I have a clipped adjustment layer( Layer 1 ) that affects Layer 0 only.  Afterwards I  enter in Layer 0 advanced blending mode and lower fill to 50% or other value and check and uncheck " blend clipped layers as a group option ". It looks different, but I cant understand why. Both layers blend mode is normal.

    Thanks for the reply...
    Me bad . You are right. Here is the situation I  really encountered:
    Checked " blend layers as a group "
    http://www.flickr.com/photos/58880156@N07/5732874879/in/photostream
    Unchecked " blend layers as a group"
    http://www.flickr.com/photos/58880156@N07/5732875367/in/photostream
    I didnt change anything except " blend layers as  a group ".

  • How to set PSD as the default for Ctrl-S when saving a layered DNG for the first time?

    Something has changed in my settings!! My Edit>Preferences>File Handling is checked to require Ask Before Saving Layered TIFF Files.
    Today I hit Ctrl-S with a layered DNG and it saved it as an Edit.tif
    What do I need to change so that the default on Ctrl-S from a Layered DNG is a Layered PSD?
    Thanks,

    Similar question. When I hit Ctrl-Alt-S, the default is TIFF; is there a way to make the default PSD?

  • Splitting layer into RGB layers in a group - newbie

    I'm a newbie trying to split a selected layer into multiple layers, each with only one channel enabled. What I mean into the script below, I’d like to do that same thing I do manually by going into Layer Style, in Advanced blending where it has the Channels R checkbox, G checkbox, B checkbox, for my R layer uncheck the G & B.
    I've got a start on grouping, copying the layers, renaming them as I'd like, but I don't know how to do the equivalent of what I described above.
    What I have so far...
    var doc = app.activeDocument,
          currentLayer = doc.activeLayer;
    var group = doc.layerSets.add();
          group.name = currentLayer.name;
    var bLayer = currentLayer.duplicate(); // duplicate layer in target doc
          bLayer.name = 'Blue:' + currentLayer.name;
             currentLayer.visible =false;
    //somehow here  I’d like to do that same thing I do manually in
    //Layer Style, in Advanced blending it has
    //Channels R checkbox, G checkbox, B checkbox
    //for my R layer uncheck the G & B
          bLayer.move( group, ElementPlacement.PLACEATEND ); // move it
          doc.activeLayer = bLayer;
    var gLayer = bLayer.duplicate();
          gLayer.name = 'Green:' + currentLayer.name;
          gLayer.blendMode = BlendMode.NORMAL;
    //somehow here  I’d like to do that same thing I do manually in
    //Layer Style, in Advanced blending it has
    //Channels R checkbox, G checkbox, B checkbox
    //for my G layer uncheck the R & B
          gLayer.opacity = 100.0;
          doc.activeLayer = gLayer;
    var rLayer = gLayer.duplicate();
          rLayer.name = 'Red:' + currentLayer.name;
          rLayer.blendMode = BlendMode.NORMAL;
    //somehow here  I’d like to do that same thing I do manually in
    //Layer Style, in Advanced blending it has
    //Channels R checkbox, G checkbox, B checkbox
    //for my R layer uncheck the G & B
          rLayer.opacity = 100.0;
          doc.activeLayer = rLayer;

    I looked around and finally did this by creating actions and then calling the actions.  I then added a loop that loops around all selected layers, using what I found at:
    https://forums.adobe.com/thread/1536677
    So with more research I answered my question.  Below is my script if others find it useful...
    #target photoshop
    alert("copying each layer in group with R, G, B layers");
    runMulti();
    // run();   
    function runMulti(){
        var selLay = getSelectedLayersIdx();
        if( selLay.constructor != Array ) selLay = [ selLay ];
        for( var i=0; i<selLay.length; i++){
            multiSelectByIDx(selLay[i]);
            run();
    function run (){
    var doc = app.activeDocument,
            currentLayer = doc.activeLayer;
    // test script: what I really want loop around all of the layers in the doc, not just the active one
    // so I want to create a group for each of the original layers
    var group = doc.layerSets.add();
            group.name = currentLayer.name;
    var bLayer = currentLayer.duplicate(); // duplicate layer in target doc
            bLayer.name = 'Blue:' + currentLayer.name;
             currentLayer.visible =false;
            bLayer.move( group, ElementPlacement.PLACEATEND ); // move it
            doc.activeLayer = bLayer;
    //what the action "blue" does is in
    //Layer Style, in Advanced blending it has
    //Channels R checkbox, G checkbox, B checkbox
    //for my B layer uncheck the R & G
              app.doAction("blue", "Default Actions");
    var gLayer = bLayer.duplicate();
            gLayer.name = 'Green:' + currentLayer.name;
            gLayer.blendMode = BlendMode.NORMAL;
            gLayer.opacity = 100.0;
            doc.activeLayer = gLayer;
    //what the action green does is in
    //Layer Style, in Advanced blending it has
    //Channels R checkbox, G checkbox, B checkbox
    //for my G layer uncheck the R & B     
             app.doAction("green", "Default Actions");
    var rLayer = gLayer.duplicate();
            rLayer.name = 'Red:' + currentLayer.name;       
            rLayer.blendMode = BlendMode.NORMAL;
            rLayer.opacity = 100.0;
            doc.activeLayer = rLayer;
    //what the action red does is in
    //Layer Style, in Advanced blending it has
    //Channels R checkbox, G checkbox, B checkbox
    //for my R layer uncheck the G & B  
              app.doAction("red", "Default Actions");
    function hasBackground(){// function to check if there is a background layer
        var res = undefined;
        try{
            var ref = new ActionReference();
            ref.putProperty( charIDToTypeID("Prpr") , charIDToTypeID("Nm  "));
            ref.putIndex( charIDToTypeID("Lyr "), 0 );
            executeActionGet(ref).getString(charIDToTypeID("Nm  ") );
            res = true;
        }catch(e){ res = false}
        return res;
    function getSelectedLayersIdx(){// get the selected layers index( positon in layer editor)
         var selectedLayers = new Array;
         var ref = new ActionReference();
         ref.putEnumerated( charIDToTypeID('Dcmn'), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
         var desc = executeActionGet(ref);
         var add = 1;
         if(hasBackground()){add = 0}
         if( desc.hasKey( stringIDToTypeID( 'targetLayers' ) ) ){
              desc = desc.getList( stringIDToTypeID( 'targetLayers' ));
              var c = desc.count
              var selectedLayers = new Array();
              for(var i=0;i<c;i++){
                   selectedLayers.push(  (desc.getReference( i ).getIndex()) + add);
         }else{
              var ref = new ActionReference();
              ref.putProperty( charIDToTypeID('Prpr') , charIDToTypeID( 'ItmI' ));
              ref.putEnumerated( charIDToTypeID('Lyr '), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
              srs = hasBackground()?executeActionGet(ref).getInteger(charIDToTypeID( 'ItmI' ))-1:executeActionGet(ref).getInteger(charIDToTypeID( 'ItmI' ));
              selectedLayers.push( srs);
         return selectedLayers;
    function multiSelectByIDx(idx) {
      if( idx.constructor != Array ) idx = [ idx ];
        var layers = new Array();
        var id54 = charIDToTypeID( "slct" );
        var desc12 = new ActionDescriptor();
        var id55 = charIDToTypeID( "null" );
        var ref9 = new ActionReference();
        for (var i = 0; i < idx.length; i++) {
              layers[i] = charIDToTypeID( "Lyr " );
              ref9.putIndex(layers[i], idx[i]);
        desc12.putReference( id55, ref9 );
        var id58 = charIDToTypeID( "MkVs" );
        desc12.putBoolean( id58, false );
        executeAction( id54, desc12, DialogModes.NO );

  • Help with Saving Progressive Layers as Video or Files

    Hi, I am interested in creating an animated video with Photoshop. I have 80+ layers, each one building on the last. For example, layer 1 is a simple horizontal line ( - ). Layer 2 is a simple vertical line ( | ). With both layers on, they form a cross ( + ). Layer 1 must be visible for layer 2 to make sense, within the video. So, each previous layer must remain visible when the next layer is turned on. Then the next, then the next.
    Previously, I have manually saved layer 1 as a JPG, turned on layer 2 and saved the new file, turned on layer 3, saved the next new file,and so on, until I go through all layers. Then I used a video editing program to put the files in sequence and render it as a video.
    I am hoping PS (CS5) can help me. I need to render a video with each layer turning on (perhaps a .03 second delay, like in the animation strip) but with all previous layers remaining on. Onion skin's max layers is 8, so that doesn't work for me.
    If I can't render the video directly from PS, how can I create an action that will
    1. save file without a prompt as JPG with the layer name as the file name, in the directory where the PSD file resides
    2. make visible the next layer up (or down, whatever)
    3. repeat until all layers are complete, no matter how many layers

    They aren't necessarily only line drawings. As an animated video, it may be line drawings, then a photo, then drawings on the photo. So it's something like this:
    layer 0 = black background
    layer 1 = white vertical line
    layer 2 = blue horizontal line
    layer 3 = photograph in the upper left corner
    layer 4 = blue dot over the photograph
    An example of one of my shorter films is
    I did that by saving every layer as a separate JPG, then putting it together in a video editor. That's how I've always done it, but that won't work anymore due to the volume of the layers.

  • Speed up saving of layered files?

    In CS4, on a first generation quad core Mac Pro with 12 gigs of RAM and scratch and all image files on a fast two disk RAID 0, I find that saving psd files with layers is extremely slow.
    If I open a 16 bit 12 megapixel D300 raw image from Lightroom into Photoshop, and immediately save it, it takes just 1 to 2 seconds to save the 60 megabyte file. But if I duplicate the background layer and save again, it takes about 15 seconds. If I duplicate two more times so there are four layers, it takes over 30 seconds to re-save the now 286 megabyte file.
    Why does this take so long? Are these numbers normal? Is there anything that can be done to speed this up? I can duplicate the file in Finder in less than 4 seconds, so I assume this has nothing to do with disk bandwidth.
    And why does saving files have to be modal? If I could start the save then switch over and start working on a different image I really wouldn't care how long it took.

    If you save with maximum compatibility, we have to composite (flatten) the document and save that PLUS the layer contents. That takes extra time.
    Yes, without major changes, saving has to be modal (due to disk access, error handling, etc.).
    Opening a file is decompressing - easy.
    Saving a file is compressing - SLOW.

  • Cs6 is saving all layers into one. Is there any way I can retrieve the layers? Help!

    I switched from CS5 to CS6 and now everything that I save, when I go back to it, it is merged into one layer.  The layer box is checked in the save dialog.  The one thing that I did do was make a pdf of of the file also in the save as menu.  I have done this a ton of times before in ealier versions and my files were never merged.  Can someone please let me know what is wrong?  I have put in hours of work and now I can't edit anything.  Can I get the layers back?

    I have noticed that this only happens after I save as a pdf in a separate file.  First, I save the file in a psd format to keep my layers, then I save as a pdf to show clients.  My other files that were saved in psd only, still have the layers.

  • Visibility bug with layers nested inside groups

    I've noticed that if a group's visibility is toggled off, any layers nested inside with individual visibility toggled on will still display. So Extract is not honoring the parent container's visibility setting. Visibility also breaks when using Layer Comps. To better illustrate:
    [off][group]
    [on][layer 1]
    [on][layer 2]
    [on][layer 3]
    All layers will still show.
    [off][group]
    [off][layer 1]
    [off][layer 2]
    [off][layer 3]
    Visibility behaves correctly.
    When handling a few layers it's not much of a deal. But often times my workflow requires me to group a large amount of layers with various visibility settings.
    Can you guys look into it? Much appreciated!

    Hi krios21-
    The top level visibility should certainly override any child layers, but there have recently been some issues with computing the right visibility when various blend modes and the like are used. It's very likely that your issue is already fixed but not yet deployed. If you would like to share the file, either publicly or privately to me via PM or mhendric (at) adobe.com, I can confirm that for you (and if not, I need to get right on fixing it :-).
    -Mitch
    P.S. You may find that, toggling some specific layers on and off causes it to fix itself. In that case, it is even more likely you've hit the condition I'm describing. It's also a way to work around the issue (even though it's inconvenient).

  • How to convert groups into layers by retaining groups names

    Hi,
    I have a file with 90 illustrations on 90 pages. Unfortunately, all illustrations are located in 90 groups but in a single layer. The groups however are named. I'd now like to convert those named groups into 90 layers by retaining their names in order to export each layer into single PNG-files with their correspondent layer-name later on.
    Any ideas anybody?
    Thanks for your help, kind regards,
    Ralf,
    Cologne

    AppleScript = mac only
    VBScript = pc only
    JavaScript = cross platform
    here's a sample in JS...it does the first part, it moves the groups to layers
    var idoc = app.activeDocument; // get active document
    var ilayer = idoc.activeLayer; // get active layer
    for (i=ilayer.groupItems.length-1; i>=0; i--) // loop thru all groups backwards
              var igroup = ilayer.groupItems[i]; // get group
              var newLayer = idoc.layers.add(); // add new layer
              newLayer.name = igroup.name; // rename layer same as group
              igroup.move(newLayer,ElementPlacement.PLACEATEND); // move group to new layer

  • Merging Layers into a Group

    When selecting a handful of layers and grouping them, all layer names, are lost. Isn't there a way to keep the layer structure inside of the Group?

    You can drag various items into a group but technically speaking you cannot put an entire layer into another group.  You can though drag a layer into another layer. To select a layer click on the radio button immediately after a layer name.
    You can then drag the colored squares to the right of the radio button and drag that you destiantion. In this ecxample you would
    Click on radio button after top
    Shift click the radio button after bot
    Drag the blue square after bot to layer 3 and drop
    Drag the red square after top to layer 3 and drop

  • Does flattening (or saving without layers) compromise the image QUALITY?

    I'm saving a large .tiff image with multiple layers, but have no need to access the different layers later on, so my question is simply if I can save the image without layers in order to reduce size, or would that also reduce the image QUALITY?

    Flattening merges all the layers and gives it a white background, the layer is then named background and is locked. Whereas merge keeps a transparent background if there is one, the remaining layer is not locked.
    A flattened image will crop any image data that falls outside the document area. So technically it does effect the quality. The same as what a crop would do.
    However it does not adjust the documents image size.
    A merged document leaves the image data outside the document area untouched.
    That said, some formats like jpg flatten the file not merge it. As it does not support transparency nor layers. Png does not support layers therefore outer data is cropped. But tiff and psd will keep outer data as both of these formats support transparency and layers. Transparency is required to stop the file from being flattened and layers is required to keep any image data that falls outside the document area from being cropped.

  • Saving non-layered file as PDF

    Why is it that when I save a file that has many, many layers to a PDF without layers as a copy that the file size is larger than flattening the layers and then saving the file as a copy to PDF? 19Mb vs. 5Mb?? Wouldn't saving a file without layers be the same as flattening the layers and then saving the file?? Can anyone explain this?

    Wouldn't saving a file without layers be the same as flattening the layers and then saving the file??
    No. that's simply not how it works. PDFs are "object"-centric, meaning even without layers there can be separate entities in a document and PS will try to obey that if and when possible based on what PDF settings you use - vector smart objects may come in separate, text may be editable, layers that have vector masks may come in at full size and so on...
    Mylenium

  • Local calendars group ​disappeared - problem with saving in the local calendars group

    Hello, I ​have been working with calendars. ​​I wanted to add ​a ​new calendar to ​the iCloud calendars group or to local calendars ("On my iPhone").​ ​
    I found that when I am switch​ing​ off the iCloud for calendars, the iCloud ​calendar ​group ​disappears and don'​t create the ​local​ storage ("On my iPhone"). ​I ​did exactly the same on the iPhone 4S, and​ it ​create​d the​ local group. I don't know ​why it​ is​ different ​on iPhone 5, ​especially as I was using iOS 7.1 ​on both.
    Has ​anyone else had this problem before? Do you know how to restore my calendar to the local storage?
    Thanks for help.

    Solved this:
    Turns out that we now require at least "List" permissions for "Everyone" for the root of the partition where the User profiles reside.
    This was not the case on our previous images.
    Hopes this helps someone else.

  • Move tool not working correctly, will not move individual layers only only groups.

    Everytime I try to move a layer within  a group it moves the entire group OR if it is not in a group it moves every single layer.
    The only way this does not happen is if I use the transform tool to move. This stinks for work-flow.
    Im not sure if I accidently made a change somewhere OR this is a bug ? Any fixes or suggestions?

    Move tool in what program?
    This forum is actually about the Cloud, not about using individual programs
    Once your program downloads and installs with no errors, you need the program forum
    If you start at the Forums Index http://forums.adobe.com/index.jspa
    You will be able to select a forum for the specific Adobe product(s) you use
    Click the "down arrow" symbol on the right (where it says ALL FORUMS) to open the drop down list and scroll

  • Transport Layers and Target Groups

    Hello,
    Can one transport layer be assigned to two different target groups?  We have some number range changes that are automatically trying to go to our FIX_QAX target group since it is config, however, the transport cannot be generated because the config is part of package KEG0 which is set up currently as part of the SAP layer which only handles the FIX_IND target group.  I was thinking of making the SAP layer go to both target groups FIX_QAX & FIX_IND.  Is there any danger of this?
    Thank you for your time,
    Erin Byrne

    i think we can't assing a transport layer to 2 different target groups. and, even connection b/n 2 target groups is not possible. i am not sure, if we can use the same transport layer (SAP) twice.
    the alternative way is.. manually (copy the data file and cofile in the other tranport domain) import the request.
    hope this info helps.
    regards,
    Rajesh.
    <i>pls, award points</i>

Maybe you are looking for

  • How can I get my InDesign app to update now that it has changed to 'canceling'?

    I am new to  Creative Cloud. This is just another example of why I feel so much discontent. I just touched the app to get it to stop. Well, it DID! The second app just changed to 'update'. This old lady needs someone to help me. Please. This is just

  • Recruitment open for Upcoming Ramp-Ups: SAP BusinessObjects GRC 10.0 Suite

    Recruitment open for Upcoming Ramp-Ups: SAP BusinessObjects Access Control 10.0 SAP BusinessObjects Risk Management 10.0 SAP BusinessObjects Global Trade Services 10.0 SAP BusinessObjects Process Control 10.0 Key Data    * Target Release to customer:

  • Problems with Samsung Monitor/Tv

    I've just bought Samsung Tv/Monitor SyncMaster T24B530, but when I connect it to muy MacBook Pro it doesn't look nice. It looks Blurred and color isn't right at all. Does anyone knows how to set it up or calibrate so as to fix this?

  • Front row or vlc

    Hi, I am stil exploring my new MBP and i found out that to play avi files in front row i have to download perian, although i can still play .avi movies in vlc. zso i wanted to know if there is any difference in watching in front row and vlc in terms

  • AdiumX Constantly Crashing after QT update

    Hi! Yesterday I updated my computer with the latest QT update 7.1.2. After the update AdiumX is crashing constantly. I've tried to uninstall, reboot, re-install... but nothing changes. Any solution? I've tried aMSN but seems slow and buggy.