Paste on multiple layers at once?

Participant ,
Jan 15, 2022 Jan 15, 2022

Copy link to clipboard

Copied

Is it possible to paste something on mutliple layers that you selected at once?

TOPICS
Actions and scripting , Windows

Views

223

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
community guidelines
Community Expert ,
Jan 15, 2022 Jan 15, 2022

Copy link to clipboard

Copied

Is this related to your similar question which was discussed a few days ago?

https://community.adobe.com/t5/photoshop-ecosystem-discussions/how-to-draw-in-multiple-layers-in-pho...

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
community guidelines
Community Expert ,
Jan 15, 2022 Jan 15, 2022

Copy link to clipboard

Copied

Copy source layer to clipboard, then select the destination layer/s and run this script (does not work with non-pixel layers):

 

/*
Paste Clipboard to Multiple Selected Layers.jsx
Stephen Marsh, v1.0 - 16th January 2022
https://community.adobe.com/t5/photoshop-ecosystem-discussions/paste-on-multiple-layers-at-once/td-p/12673987
NOTES:
Copy source layer to clipboard, then select the destination layer/s and run this script (does not work with non-pixel layers)
*/

#target photoshop

/***** Process Selected Layers from Jazz-y *****/
var s2t = stringIDToTypeID;
(r = new ActionReference).putProperty(s2t('property'), p = s2t('targetLayersIDs'));
r.putEnumerated(s2t('document'), s2t('ordinal'), s2t('targetEnum'));
var lrs = executeActionGet(r).getList(p),
    sel = new ActionReference();
for (var i = 0; i < lrs.count; i++) {
    sel.putIdentifier(s2t('layer'), p = lrs.getReference(i).getIdentifier(s2t('layerID')));
    (r = new ActionReference).putIdentifier(s2t('layer'), p);
    (d = new ActionDescriptor()).putReference(s2t("target"), r);
    executeAction(s2t('select'), d, DialogModes.NO);
/***** Process Selected Layers from Jazz-y *****/
    
    if (app.activeDocument.activeLayer.kind == LayerKind.NORMAL) {

        // Select All
        app.activeDocument.selection.selectAll();

        // Paste In Place
        var idpaste = stringIDToTypeID("paste");
        var desc1571 = new ActionDescriptor();
        var idinPlace = stringIDToTypeID("inPlace");
        desc1571.putBoolean(idinPlace, true);
        var idantiAlias = stringIDToTypeID("antiAlias");
        var idantiAliasType = stringIDToTypeID("antiAliasType");
        var idantiAliasNone = stringIDToTypeID("antiAliasNone");
        desc1571.putEnumerated(idantiAlias, idantiAliasType, idantiAliasNone);
        var idas = stringIDToTypeID("as");
        var idpixel = stringIDToTypeID("pixel");
        desc1571.putClass(idas, idpixel);
        executeAction(idpaste, desc1571, DialogModes.NO);

        // Merge Down
        var idmergeLayersNew = stringIDToTypeID("mergeLayersNew");
        var desc1573 = new ActionDescriptor();
        executeAction(idmergeLayersNew, desc1573, DialogModes.NO);

        // Deselect
        app.activeDocument.selection.deselect();

    } else {
        alert('The selected layer is not a "normal" pixel layer')
    }
}

 

https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html

 

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
community guidelines
Participant ,
Jan 15, 2022 Jan 15, 2022

Copy link to clipboard

Copied

Okay thank you! Could you possibly give me a visual as to where I'm taking that though? I'm just not quite sure where I'm supposed to paste. You also say "select the destination layers," could you elaborate on that too please? I honestly can't tell if I know what that's referring to.

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
community guidelines
Community Expert ,
Jan 15, 2022 Jan 15, 2022

Copy link to clipboard

Copied


@Malevolent Rainbow wrote:

Okay thank you! Could you possibly give me a visual as to where I'm taking that though? I'm just not quite sure where I'm supposed to paste. You also say "select the destination layers," could you elaborate on that too please? I honestly can't tell if I know what that's referring to.


 

You don't paste, the script does that for you to the multiple selected layers.

 

Step 1: Select/target/activate the layer and copy to the clipboard:

1.png

Here Layer 2 is the source, Layer 0 & Layer 1 will be the destination/target layers

 

Step 2: Select/target/activate Layer 0 & Layer 1

2.png

Layer 0 & Layer 1 selected/targeted/activated

 

Step 3: Run the script

3.png

Layer 0 & Layer 1 now have the copied content from Layer 2

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
community guidelines
New Here ,
Aug 28, 2022 Aug 28, 2022

Copy link to clipboard

Copied

Is it possible to make this script work for vector layers?

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
community guidelines
Community Expert ,
Aug 28, 2022 Aug 28, 2022

Copy link to clipboard

Copied


@jeffreynuez wrote:

Is it possible to make this script work for vector layers?


 

Possibly, however I'm guessing that it is not as simple as for raster data.

 

Can you post a cropped screenshot of the layers panel?

 

Is the source layer kind a shape layer or vector smart object?

 

What is the destination layer kind and is it blank?

 

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
community guidelines
New Here ,
Aug 28, 2022 Aug 28, 2022

Copy link to clipboard

Copied

Screen Shot 2022-08-28 at 7.44.14 PM.png

I was looking to copy one of these shapes and paste it in place to the rest of them.

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
community guidelines
Community Expert ,
Aug 29, 2022 Aug 29, 2022

Copy link to clipboard

Copied

I have had a play and have come to the conclusion that live shapes and vectors from live shapes are complicated to deal with as you request.

 

Deleting and dupliating would be somewhat easier than copy/paste.

 

Perhaps another more advanced scripter would like to give it a go.

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
community guidelines
Community Expert ,
Aug 29, 2022 Aug 29, 2022

Copy link to clipboard

Copied


I have had a play and have come to the conclusion that live shapes and vectors from live shapes are complicated to deal with as you request.

Would duplicating the one Shape Layer, moving it in front of one of the receiving Shape Layers, selecting both Layers and »Merge Shapes« (and iterating through all the receiving Shape Layers) work? 

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
community guidelines
Community Expert ,
Aug 29, 2022 Aug 29, 2022

Copy link to clipboard

Copied


@jeffreynuez wrote:

Is it possible to make this script work for vector layers?


What is the point here? 

 

Could you please post meaningful screenshot (the whole canvas with all pertinent Panels) to illustrate what the starting point is and what the result should be? 

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
community guidelines
New Here ,
Aug 29, 2022 Aug 29, 2022

Copy link to clipboard

Copied

LATEST

So I'm currently working on extremely large PSD files that range from 500 to 1,000 assets.

Screen Shot 2022-08-29 at 10.17.23 AM.png

Each asset has a bounding box shape and a vector mask within them that should not be moved as the artist create their art in the art layers. All of the shapes and vector masks should be in the same size and position.

Screen Shot 2022-08-29 at 10.16.06 AM.png

Screen Shot 2022-08-29 at 10.15.12 AM.png

 

 The current issue is that the artists still move and resize them. When this happens I reshape the first one and then I isolate all assets by name and then copy and paste in the same position to each shape. I've tried looking into a couple of methods to make this faster but no luck just yet. I know coping and pasting the vector mask isn't possible but I'm hoping that shapes can be done in mass through a script. 

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
community guidelines