• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Select Frame Layer + its contents

Engaged ,
Jun 26, 2019 Jun 26, 2019

Copy link to clipboard

Copied

Hello everyone,

Photoshop CC 2019 introduced the new frame tool. which is quite useful.

As I was trying to automate my work today, I wanted to Free Transform the Frame + Contents so in order to do this i need to select both.

I couldn't find a solution using actions because it just selects the Frame layer, like this:

But I need both, like this:

I have tried the Alt+[ ] that I would normally use in actions, but it doesn't choose the contents.

Maybe via script it might work, any ideas?

TOPICS
Actions and scripting

Views

1.8K

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

correct answers 1 Correct answer

Guide , Jun 27, 2019 Jun 27, 2019

Another version, that checks which is selected (must have a frame layer selected)

#target photoshop;

if(app.activeDocument.activeLayer.blendMode == BlendMode.PASSTHROUGH){

var Frame1 = activeDocument.activeLayer.id;

var Frame2 = activeDocument.activeLayer.layers[0].id;

}else{

var Frame1 = activeDocument.activeLayer.parent.id;

var Frame2 = activeDocument.activeLayer.id;

}

selectLayerById(Frame1);

selectLayerById(Frame2,true);

function selectLayerById(id,add){

var ref = new ActionReference();

ref.putIdentifie

...

Votes

Translate

Translate
Adobe
Explorer ,
Jun 26, 2019 Jun 26, 2019

Copy link to clipboard

Copied

The frame and the picture each have their own Layer ID.

You can select them via the ID's.

function selectLayerById(id, add) {

    var ref = new ActionReference();

    ref.putIdentifier(charIDToTypeID('Lyr '), id);

    var desc = new ActionDescriptor();

    desc.putReference(charIDToTypeID("null"), ref);

    if (add) desc.putEnumerated(stringIDToTypeID("selectionModifier"), stringIDToTypeID("selectionModifierType"), stringIDToTypeID("addToSelection"));

    //Sichtbarkeit der Ebene

    desc.putBoolean(charIDToTypeID("MkVs"), false);

    executeAction(charIDToTypeID("slct"), desc, DialogModes.NO);

};

selectLayerById(frameID);

selectLayerById(imgID, true);

Votes

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
Engaged ,
Jun 26, 2019 Jun 26, 2019

Copy link to clipboard

Copied

we're getting there, how do I know what is my frameID and my imgID?

usually the layer is 1 layer before the bottom:

Votes

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
Guide ,
Jun 26, 2019 Jun 26, 2019

Copy link to clipboard

Copied

They are based on a layerset.

You could select both by...

#target photoshop;

if(activeDocument.activeLayer.name.match(/Frame$/)){

var Frame1 = activeDocument.activeLayer.id;

var Frame2 = activeDocument.activeLayer.layers[0].id;

selectLayerById(Frame1);

selectLayerById(Frame2,true);

}

function selectLayerById(id,add){

var ref = new ActionReference();

ref.putIdentifier(charIDToTypeID('Lyr '), id);

var desc = new ActionDescriptor();

desc.putReference(charIDToTypeID("null"), ref );

if(add) desc.putEnumerated( stringIDToTypeID( "selectionModifier" ), stringIDToTypeID( "selectionModifierType" ), stringIDToTypeID( "addToSelection" ) );

desc.putBoolean( charIDToTypeID( "MkVs" ), false );

try{

executeAction(charIDToTypeID("slct"), desc, DialogModes.NO );

}catch(e){}

};

Votes

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
Guide ,
Jun 27, 2019 Jun 27, 2019

Copy link to clipboard

Copied

Another version, that checks which is selected (must have a frame layer selected)

#target photoshop;

if(app.activeDocument.activeLayer.blendMode == BlendMode.PASSTHROUGH){

var Frame1 = activeDocument.activeLayer.id;

var Frame2 = activeDocument.activeLayer.layers[0].id;

}else{

var Frame1 = activeDocument.activeLayer.parent.id;

var Frame2 = activeDocument.activeLayer.id;

}

selectLayerById(Frame1);

selectLayerById(Frame2,true);

function selectLayerById(id,add){

var ref = new ActionReference();

ref.putIdentifier(charIDToTypeID('Lyr '), id);

var desc = new ActionDescriptor();

desc.putReference(charIDToTypeID("null"), ref );

if(add) desc.putEnumerated( stringIDToTypeID( "selectionModifier" ), stringIDToTypeID( "selectionModifierType" ), stringIDToTypeID( "addToSelection" ) );

desc.putBoolean( charIDToTypeID( "MkVs" ), false );

try{

executeAction(charIDToTypeID("slct"), desc, DialogModes.NO );

}catch(e){}

};

Votes

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
Engaged ,
Jun 27, 2019 Jun 27, 2019

Copy link to clipboard

Copied

LATEST

Perfect, I tried the first and it worked very good, thank you!!!

Votes

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