Script to add the layer mask to all layers but the background?

I have been a professional editor/Retoucher for photographers for the past three years. I use a lot of stock, but I've never branched in scripts so far. I am trying to refine my workflow and scripts to not appear to be the next logical step.

I do a lot of work in the interiors, which is essentially manual HDR. Here's my current generation process, which I would love to find a way to script. I tried to be very clear, but let me know if it needs to expand. I use Photoshop CS5.

1. pull brackets, color corrected TIFF in Bridge.

2 re-order as needed, with the main exhibition downstairs. Click on 'Tools' > 'Photoshop' > 'Charge in the form of layers Photoshop"to get a PSD with layers in the correct order and main as exposure layer from bottom (base).

3. manually go through each layer and add a layer mask hide all each layer except the background layer.

4. Save as a PSD, using the original name of the background layer as the file name. To do this, I just copy the name of the layer (example.tiff), paste in the Save dialog box and then use the drop-down menu to select PSD (save as example.psd).

I hope to automate steps 3 and 4 as they are the majority of your time for me. Any contribution is appreciated!

Thanks again.

Yes, your change is good.  This way the last layer will not have a mask applied.  I wasn't sure if you wanted that, but in the control for the background layer.

Regarding the economy, what file format would you save on?  Here's how to save a psd:

docRef var = activeDocument

var doneFolder = new Folder('/c/photos/')

var NomCouche = docRef.activeLayer.name

var psdOptions = new PhotoshopSaveOptions();

psdOptions.layers = true;

app.displayDialogs = DialogModes.ALL;//include this line if you want that the coming dialog box.

docRef.saveAs (new file (doneFolder + "/" + NomCouche + ".psd"), psdOptions);

app.displayDialogs = DialogModes.NO;//Resets at ALL - you won't let it work on.

Tags: Photoshop

Similar Questions

  • Listener code to add a layer mask does not work...

    With the help of Photoshop CC 2014 with all updates. The following script listener code has been saved when I clicked on the button, add a layer mask to add a mask to the active layer. When executeAction is called the script fails with the following error message. Help! How can I add a layer mask to the layer? Thank you.

    : Error General Photoshop. Maybe this feature is not available in this version of Photoshop. -The command 'Make' is not currently available.

    function addLayerMask() {}

    Adds a layer mask to the layer by clicking on the

    Add the button layer mask.

    var idMk = charIDToTypeID ("Mk");

    var desc23 = new ActionDescriptor();

    var idNw = charIDToTypeID ('Nw');

    var idChnl = charIDToTypeID ('channel');

    desc23.putClass (idNw, idChnl);

    var idAt = charIDToTypeID ('At');

    var ref20 = new ActionReference();

    var idChnl = charIDToTypeID ('channel');

    var idChnl = charIDToTypeID ('channel');

    var idMsk = charIDToTypeID ("Msk");

    ref20.putEnumerated (idChnl, idChnl, idMsk);

    desc23.putReference (idAt, ref20);

    var idUsng = charIDToTypeID ("Usng");

    var idUsrM = charIDToTypeID ("rocket");

    var idRvlS = charIDToTypeID ("LVR");

    desc23.putEnumerated (idUsng, idUsrM, idRvlS);

    executeAction (idMk, desc23, DialogModes.NO);

    }

    This code works if you have an active selection.

    function addLayerMask() {}

    Adds a layer mask to the layer by clicking on the

    Add the button layer mask.

    var idMk = charIDToTypeID ("Mk");

    var desc23 = new ActionDescriptor();

    var idNw = charIDToTypeID ('Nw');

    var idChnl = charIDToTypeID ('channel');

    desc23.putClass (idNw, idChnl);

    var idAt = charIDToTypeID ('At');

    var ref20 = new ActionReference();

    var idChnl = charIDToTypeID ('channel');

    var idChnl = charIDToTypeID ('channel');

    var idMsk = charIDToTypeID ("Msk");

    ref20.putEnumerated (idChnl, idChnl, idMsk);

    desc23.putReference (idAt, ref20);

    var idUsng = charIDToTypeID ("Usng");

    var idUsrM = charIDToTypeID ("rocket");

    var idRvlS = charIDToTypeID ("LVR");

    desc23.putEnumerated (idUsng, idUsrM, idRvlS);      reveal selection

    executeAction (idMk, desc23, DialogModes.NO);

    }

    app.activeDocument.selection.selectAll ();

    addLayerMask();

    To add a layer mask without an active selection is the scriptlistener code you would need

    function addLayerMask() {}

    var idMk = charIDToTypeID ("Mk");

    var desc25 = new ActionDescriptor();

    var idNw = charIDToTypeID ('Nw');

    var idChnl = charIDToTypeID ('channel');

    desc25.putClass (idNw, idChnl);

    var idAt = charIDToTypeID ('At');

    ref19 var = new ActionReference();

    var idChnl = charIDToTypeID ('channel');

    var idChnl = charIDToTypeID ('channel');

    var idMsk = charIDToTypeID ("Msk");

    ref19.putEnumerated (idChnl, idChnl, idMsk);

    desc25.putReference (idAt, ref19);

    var idUsng = charIDToTypeID ("Usng");

    var idUsrM = charIDToTypeID ("rocket");

    var idRvlA = charIDToTypeID ("RvlA");

    desc25.putEnumerated (idUsng, idUsrM, idRvlA);  reveal all

    executeAction (idMk, desc25, DialogModes.NO);

    }

    addLayerMask()

    There are once again hide all

    var idMk = charIDToTypeID ("Mk");

    var desc33 = new ActionDescriptor();

    var idNw = charIDToTypeID ('Nw');

    var idChnl = charIDToTypeID ('channel');

    desc33.putClass (idNw, idChnl);

    var idAt = charIDToTypeID ('At');

    var ref27 = new ActionReference();

    var idChnl = charIDToTypeID ('channel');

    var idChnl = charIDToTypeID ('channel');

    var idMsk = charIDToTypeID ("Msk");

    ref27.putEnumerated (idChnl, idChnl, idMsk);

    desc33.putReference (idAt, ref27);

    var idUsng = charIDToTypeID ("Usng");

    var idUsrM = charIDToTypeID ("rocket");

    var idHdAl = charIDToTypeID ("HdAl");

    desc33.putEnumerated (idUsng, idUsrM, idHdAl);     Hide all

    executeAction (idMk, desc33, DialogModes.NO);

  • A script to add several layer text names

    Hello world

    I am quite new to this, so I hope you don't mind if my question is maybe a bit simple for the pros...

    Basically, I'm looking for a way to add multiple names of layers in the form of text boxes. I found this script below pixxxelschubser, which already ensures the task.

    Re: Script to add the name of the layer to the artboard in text form

    However, this script updates all the text boxes in a position to (0,0). I'm looking for a way to change this, until the first box (0,0), the second area is (0.10), third (0.20) and so on.

    I guess it's sort of a loop thing, but I'm really not familiar with this, so just a little hint would be great

    Thanks in advance!

    Marco

    If you want to get into writing scripts, check out the official guides here

    Illustrator script | Adobe Developer Connection

    Adobe assumes that you are already familiar with javascript, so you need to learn javascript separately, you can start here

    JavaScript | DND

    Here is a version of the pixxxel script that moves the vertical position

    // LayersnamesInUpperLeftCorner.jsx
    // https://forums.adobe.com/thread/1546630
    // write layers names in upper left corner of the active artboard
    // required: opened document, no toplevel layers locked, all layers visible
    // regards pixxxelschubser
    var aDoc = app.activeDocument;
    var theLayers = aDoc.layers;
    var x = 0;
    var y = 0;
    var verticalOffset = 10;
    
    for (i=0; i		   
  • Add a layer mask shortcut?

    Hello, it is posible to add a shortcut to 'add a layer mask "?

    I can't find. Thank you

    Hi chochography,

    Select Edit > keyboard shortcuts and assign your own shortcuts for layer > layer mask > reveal all the

    Kind regards

    Assani

  • 'Add a layer mask "command.

    Hello

    Anyone know if there is a command 'add a layer mask "?  I've searched high and low and can't find it.  I could do an action assumes, but I thought I might ask the experts.

    Thank you.

    Just add a button in the menu photostops LAYER / LAYER MASK / REVEAL ALL or HIDE ALL if function

    you want a new white or black mask.

  • How to add the background image to the screen

    Hi all

    I want to add the background image to the main screen how can I do it.

    On the main screen, I used

    -a manager of HorizontalFieldManagerField to view the bitmapField (horizontally).

    -a manager of VerticalFieldManagerField to view the bitmapField (vertically).

    already images of display screen (bitmap field) with Horizontal and Vertical Manager, but I also want to display the background image for the screen, how can I reach this help me please.

    Concerning

    Adkins

    Thanks for all the response, I tried and sloved logic here how I did

     VerticalFieldManager mainVerticalManager = new VerticalFieldManager(Manager.NON_FOCUSABLE|Manager.NO_HORIZONTAL_SCROLL|Manager.NO_VERTICAL_SCROLL){
                protected void paintBackground(Graphics graphics)
             {  
    
             }
             protected void sublayout( int maxWidth, int maxHeight )
             {
    
             }
            };
    
    then i added other to manager on to this
    

    My problem is sloved thank you for the reply

  • Script to add the virtual computer to the inventory of different data warehouses

    I need a script that will go through all available databases and add the virtual machine inside of them in inventory.


    I know how to do this with:

    New-VM - VMFilePath ' [DATASTORE] vmfolder/vmname.vmx "-VMHost (Get-Cluster"NOMCLUSTER"|) Get-VMHost | Get - Random) - place (Get-folder folder_name) - RunAsync

    But we have hundreds of data stores and thousands of virtual machines. I suck at writing scripts in a loop, but it looks like that's what I need. I tried using wildcards for the VMFilePath - but it does not work. Must be another way.

    Any help would be greatly appreciated!

    Oh, I fixed it. I had a host that was plundered with partial connectivity to storage. The script was repeatedly tries to connect to this host jacked up.

    I managed to work around the problem by changing "Get-VMHost | Select - first 1 "to" Get-VMHost | Get-Random.

    Works fine now... as do all things Luke and Lam

  • Add a layer mask

    Hello

    I came across this thread in the forum of items https://forums.adobe.com/thread/798304 and had the same question for the CC PS (I don't have the elements to see if this suggestion works there). I tried to add a selection to the layer mask to my pressing Shift/Ctrl and clicking on the thumbnail of the mask, but it does not work (the result has been to deselect the new selection and simply load the mask selection). Other/different way could there be to do?

    Thank you

    -David

    What operating system do you use?

    The same procedure, spoken in the post that you linked to should also work in photoshop cc

    But it probably really can't load the existing layer mask selection.

    After that you have the choice, you want to add to the layer mask, simply target the layer mask (click on the thumbnail of the layer mask to make it active), and then fill the selection with black or white.

  • script to add the location of the log file

    Hello

    I am having trouble with a script that I wrote a year or two ago for the 5.1 vSphere hosts. Now I'm looking to run on vSphere 5.5 hosts, and I make mistakes.

    # Connection to the ESX host to be configured.
    $a = Read-Host "Please enter ESX FQDN:
    Connect-VIServer-Server "$a" - Credential(Get-Credential) se

    # Set the directory SYSLOG #.
    $hostName = get-VMHost
    $hostName = $hostName.Name.Split(".") [0]
    $logLocation = "[AVH-ESXLogs]" + $hostName
    Game-AdvancedSetting Syslog.global.logDir - value $logLocation

    Disconnect-VIServer $a - confirm: $false

    When I run the script, I get the following error:

    Cannot bind the parameter "AdvancedSetting". Impossible to convert the value of 'Syslog.global.logDir' to type 'System.String' type 'VMware.VimAutomation.ViCore.Types.V1.AdvancedSetting '.

    To: C9: tank: 19

    + Set AdvancedSetting < < < < Syslog.global.logDir - value $logLocation

    I'm guessing it's something stupid, I was messing around with this script for a few hours and it's starting to all look the same.

    Thanks for the help.

    Eric

    You will need to do a Get-AdvancedSetting front, something like that

    Get-AdvancedSetting - $vmhost - name Syslog.global.logDir entity. Game-AdvancedSetting - value $logLocation

    You get the current setting and then redirect to the next cmdlet, which makes the change.

    See also the examples on the Set-AdvancedSetting cmdlet.

  • Stop to add the background color to div

    On this site http://mabelspralines.com/about.html I want to fix the bg of the container for white on each page and leave the yellow bg outside. (You can see where the bg Graph stops at halfway to the bottom of the page)

    I am helping to review some things for this lady, but I do so much and I'm out of practice with CSS. How to find what item to change? The original designer has an extra bunch of CSS and it seems neither respond to the edition/background-background color

    http://mabelspralines.com/styles/global.CSS

    TIA!

    Set the background color of the #container in white as shown below (I put in the comment / * / current background color and introduce the new rule css after that.)

    .twoColFixLtHdr #container {}

    Width: 800px;

    border: 1px solid #CAACF2;

    margin: 0 auto; / * margins (in conjunction with a width) auto Center the page * /.

    border: 1px solid #CAACF2;

    text-align: left; / * This setting overrides the text-align: center on the body element. */

    / * background-color: #FAF1C6; * /

    background-color: #fff;

    background-repeat: repeat;

    }

    Is that what you want?

  • How to add a layer mask?

    It may be simple, but it seems confusing, please I need help

    Assuming that the variable myLayer is a layer object, the collection of all its masks is: myLayer.property ("ADBE Mask Parade");

    and his children are the groups of actual masks (which can be renamed). To add a mask to the collection, you do:

    var myMask = myLayer.property("ADBE Mask Parade").addProperty("ADBE Mask Atom");
    

    You can define the name, color, attributes of Rotobezier etc. (optional):

    myMask.name = "My mask";
    myMask.color = [1,0,0];
    myMask.rotoBezier = false;
    myMask.maskMode = MaskMode.ADD;
    

    To set its keyframable properties: property maskPath has special propertyType (SHAPE).

    You must create a Shape() object like this before you set the value:

    var myShape = new Shape();
    // set the vertices (coordinates of the vertices in layer coordinates, not comp)
    // + the inTangents (coordinates of the incoming Bezier handles with respect to the the corresponding vertices)
    // + the outTangents (coordinates of the outcoming Bezier handles with respect to the the corresponding vertices)
    // + the closed attributes
    var w = myLayer.width, h = myLayer.height;
    myShape.vertices = [[w/2, 0], [w,h], [0,h]];            // here: array of 3 "points"
    myShape.inTangents = [[0, 0], [0, 0], [0, 0]];        // array of 3 "vectors"
    myShape.outTangents = [[0, 0], [0, 0], [0, 0]];        // array of 3 "vectors"
    myShape.closed = true;
    // now set the value:
    myMask.property("ADBE Mask Path").setValue(myShape);
    

    In this example, all the tangents are 0 which gives a straight contour mask.

    Unless you have your loan of shape data, insert more complex values of the tangents is not so much straighforward.

    Xavier.

  • Script to add the reference frame graphic Page

    Okay, I'm ready to pull my hair. I looked up and down the internet to find a place where I can see the segment RJ Jacquez on the script that allows you to add images of your framework reference pages to HR styles for tip/note/WARNING/whatever. The only thing I can find is a twitter link, and I can't access Twitter to work. Help, please!

    Thanks in advance... Melissa

    Hi Melissa,

    The javascript required to add images of your pages to reference the framework styles HR shared @ https://acrobat.com/#d=ddHvZY7gelnzm8rqwlAIXQ it is public and does not require a log in

    Hope this helps

    Ashish

  • Is there a script to make changes specific attrubute to all layers in the project?

    Hello and thanks for your time!

    I have a project that contains a large number of compositions with many layers of shape of each.

    Is there a way to make global changes to property size STROKE of shape layers, for example 0px 1px?

    Thank you.

    This should work for you. Down is the line of code that you can set the value of the width. It will look like this a.property (i) .setValue (1.0); //STROKE WIDTH VALUE

    BEGINNING

    var app.project = proj;

    var comps = getAllProjectComps (proj);

    for (var i = 0; i)

    searchLayersAndChangeVal (comps [i]);

    }

    function getAllProjectComps (sourceFolder) {}

    try {}

    var itemAry, itemsInFolder, itemsInFolderLength;

    itemAry = new Array();

    itemsInFolder = sourceFolder.items;

    itemsInFolderLength = itemsInFolder.length;

    for (var i = 1; i)<=itemsInFolderLength;>

    If (itemsInFolder [i] instanceof CompItem) {}

    itemAry [itemAry.length] = itemsInFolder [i];

    }

    }

    Return itemAry;

    } catch (err) {alert ("error at line #" + err.line.toString () + "\r" + err.toString ()) ;}}

    }

    function searchLayersAndChangeVal (compSource) {}

    var layerCollect = compSource.layers;

    var layerCollectLength = layerCollect.length;

    var curLayer, accessories, propsLength;

    var propObjAry = new Array();

    for (var l = 1; l)<=layerCollectLength;>

    curLayer = layerCollect [l];

    If (curLayer instanceof ShapeLayer) {}

    getStrokeWidthAndChangeValue (curLayer);

    }

    }

    }

    function getStrokeWidthAndChangeValue (a) {}

    try {}

    var propLength = a.numProperties;

    for (var i = 1; i)<=propLength;>

    If (a.property (i) .matchName == "ADBE vector Stroke Width") {}

    a.Property (i). SetValue (1.0);          VALUE OF LINE WIDTH

    }

    If (a.property (i) .numProperties > 0) {}

    getStrokeWidthAndChangeValue (a.property (i));

    }

    }

    } catch (err) {alert (err.line.toString () + "\r" + err.toString ()) ;}}

    }

    END

  • Attempt to add a soft music to all layers

    Hi all!  I'm thinking about the best method to add a solid layer for my entire project.  My goal is to give the video, which is used as a demonstration of the software, a bit of oomph!  We have a voice to narrators on all slides already takes place layer audio slide, so I need to add this soft music in the sound of a hidden object game properties.  Now, I can easily see how it would happen, but I don't know how you would eliminate the noise jumping from one slide to another.  You can edit audio from one slide to another unless it is the main audio layer.

    Do you think I need to look at the different software for that?

    Thank you

    Jeff

    Hi Jeff

    Try clicking on Audio > background sound...

    See you soon... Rick

    Useful and practical links

    Captivate wish form/Bug report form

    Certified Adobe Captivate training

    SorcerStone blog

    Captivate eBooks

  • New version FF3.63 causes a screen faded with script running in the background. I understand that it may not be fully compatible with 64-bit. I was perfectly happy to 3.59 and want to downgrade, is this possible and how?

    I would like to revert to the version 3.59. 3.63 is slow and buggy on my unit.

    This has happened

    Each time Firefox opened

    I installed the new version today

    User Agent

    Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729 .NET CLR 3.0.30729; Media Center PC 6.0)

    You can get 3.5.9 here: http://www.mozilla.com/en-US/firefox/all-older.html

    But 3.6.3 should work just fine. You have Add-ons installed, which may be the cause of the problem?

Maybe you are looking for