How to handle mutiple selected layers in photoshop by ExtendScript?

I can't understand how to access more than one layer selected in ExtendScript for photoshop. I came from scripts for 3ds max and maya and flash. I can easily manipulate the layers selected in a table, but I can't find how to do this in Photoshop anyway. Thanks in advance!

I found this posted by Paul Riggott it may help understand you.

sLayers var = getSelectedLayersIdx();

var names = new Array();

for (var an in sLayers) {}

Names.push (getLayerNameByIndex (Number (sLayers [a])));

}

Alert (Names.Join ('\n'));

function getLayerNameByIndex (idx) {}

Var ref = new ActionReference();

ref.putIndex (charIDToTypeID ("Lyr"), idx);

return executeActionGet (Ref) .getString (charIDToTypeID ("Nm"));

};

function getSelectedLayersIdx() {}

var selectedLayers = new Array;

Var ref = new ActionReference();

ref.putEnumerated (charIDToTypeID ("Dcmn"), charIDToTypeID ("Ordn"), charIDToTypeID ("Trgt"));

var / / desc = executeActionGet (ref);

If (desc.hasKey (stringIDToTypeID ("targetLayers"))) {}

DESC = desc.getList (stringIDToTypeID ('targetLayers'));

var c = desc.count

var selectedLayers = new Array();

for (var i = 0; i)<>

try {}

activeDocument.backgroundLayer;

selectedLayers.push (desc.getReference (i). getIndex());

} catch (e) {}

selectedLayers.push (desc.getReference, (i), .getIndex () + 1);

}

}

} else {}

Var ref = new ActionReference();

ref.putProperty (charIDToTypeID ("Rprp"), charIDToTypeID ("ItmI'));

ref.putEnumerated (charIDToTypeID ("Lyr"), charIDToTypeID ("Ordn"), charIDToTypeID ("Trgt"));

try {}

activeDocument.backgroundLayer;

selectedLayers.push (executeActionGet (Ref), .getInteger (charIDToTypeID ("ItmI"))-1);

} catch (e) {}

selectedLayers.push (executeActionGet (Ref) .getInteger (charIDToTypeID ("ItmI")));

}

var vis = app.activeDocument.activeLayer.visible;

if(vis == true) app.activeDocument.activeLayer.visible = false;

var desc9 = new ActionDescriptor();

var list9 = new ActionList();

var ref9 = new ActionReference();

Ref9.putEnumerated (charIDToTypeID ('Lyr'), charIDToTypeID ('Ordn'), charIDToTypeID ('Trgt'));

list9.putReference (ref9);

desc9.putList (charIDToTypeID ('null'), list9);

executeAction (charIDToTypeID ("'Shw"), desc9, DialogModes.NO);

if(App.activeDocument.activeLayer.Visible == false) selectedLayers.shift ();

app.activeDocument.activeLayer.visible = live;

}

Return selectedLayers;

};

Tags: Photoshop

Similar Questions

  • How to get the selected layers?

    Hi, how can I use the SDK for a list of the layers that are selected by the user when the plugin is activated?

    Let's talk terminology.

    an "activation" on a layer effect is not really the process of events.

    When an effect is used firstly to æ session, this is the function GlobalSetup()

    is called.

    This is the most 'activated' like thing in the effect by applying the process.

    This function is called only once per session (in general) and data

    allocated to it is shared between all instances.

    then, whenever a new instance is applied, the specific instance

    Function SeqeunceSetup() is called.

    It is the only clue you get tell you that a new instance is created.

    Unfortunately, in the course of this appeal you still cannot check the layer on which

    the effect will be applied, as at that time there AE still because preparations

    and has not done this topic yet. (try to get the effect layer will

    give an error)

    so when you say "on" I'm assuming you mean "applied".

    If an instance of the effect is already present in an economy effect, you get not one

    Call of SequenceSetup(), but a SequenceResetup() call instead. (or Unflatten())

    now, to detect if another instance is present on a layer, you must analyze

    This layer effects and check each because it is installed a key. (and match

    to you, of course)

    you will need to use:

    AEGP_GetLayerNumEffects

    AEGP_GetLayerEffectByIndex

    AEGP_GetInstalledKeyFromLayerEffect

    and now you hit the real problem.

    an effect cannot remove another effect of the same layer, sure it is. It will be

    very probably launch an error message as AE manages all the layer effects

    and suddenly; y an is missing.

    You can solve that by using a CEAP separated with a slow hook and make the

    deletion, or all just throwing your own message to the user by saying

    You cannot have two and set a flag on the second instance of turn it off

    process.

  • How to select layers by ID

    My extension HTML Panel listening to JSONEvents, as this SELECTION:

    { "eventID": 1936483188, "eventData": {"layerID":[2,97],"makeVisible":false,"null":{"_name":"back1.jpg","_ref":"layer"},"selectionModifier":{"_enum":"selectionModifierType","_value":"addToSelectionContinuous"}}}
    

    In the event handler, the script is to store the selected layer s 'layerID"in a table.

    How can I select these layers later by the ID stored with a .jsx call?

    Should be simple, but I can't find a way.

    Is it possible to convert the ID of the Index layer?

    Thank you very much!

    selectLayerById(98); //select this layer only
    selectLayerById(80,true); //select this layer along with other selected layers
    
    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){}
    };
    
  • How to import all layers in Photoshop at once?

    Hello

    I'm trying to import a Photoshop psd file into AE. This file has a lot of layers. When I file > import > file, he asks me if I want to import images or layers.

    When I selected layers, I wonder which layers I want to import into. It's a lot of time as I import one layer at a time. How can I import all the layers in a single shot?

    Thank you

    See you soon

    Choose import as a composition. Check the help files. There are two options.

  • How to clear sticky-selection layer with the tool around in Photoshop CC?

    In Photoshop CC, you can click and drag the tool move to select more than one layer.  But sticky selection seems to be a novelty.

    In the attached screenshot, you can see that I have selected several layers of a graphic illustration.  Marquee of the move (not to be confused with the pixel-selection) tool is liked to touch these layers, but they remain selected.  Suppose that I have selected some of these layers accidentally: when I move the marquee away unwanted layers, I want than Photoshop to deselect them.  I don't want to restart a selection each time that my wrist shaking during the selection process.

    I realize that there are several ways to select layers.  I'm not looking for alternative solutions.  No sticky home or go.

    I am under Photoshop CC (2015.0.0 version) on OSX 10.11.5.

    Screen Shot 2016-06-14 at 1.44.53 PM (2).jpg

    It is in the upper left corner of your screen capture: Uncheck self-select layers.

  • How to print a selection of an image in photoshop CC, I have problems because in the print window does not display the full image and the printed only a section of what I SELECTED

    How to print a selection of an image in photoshop CC, I have problems because in the print window does not display the full image and the printed only a section of what I SELECTED

    Hi jodepepevalentin,

    In the print menu, check "scale to fit media" under the Position and size of the device and then check out.

    If you want the area selected for printing, check "Print selected area" under the Position and size and specify the size.

    Kind regards

    Claes

  • Hi, my photoshop won't allow me to select layers with my mouse, I have to go to each individual layer on the side to select. On the computers at my school, I was always able to select a layer group to the right of the file I'm working on that. Having

    Hi, my photoshop won't allow me to select layers with my mouse, I have to go to each individual layer on the side to select. On the computers at my school, I was always able to select a layer group to the right of the file I'm working on that. Have to go to the layers panel and select each layer one is really long time and not effective - what do I do to fix this?

    Hi Cartere49372123,

    I hope you do well.

    Please check this link below and see if it helps

    http://www.photoshopessentials.com/basics/layer-shortcuts/

    Concerning

    Rohit

  • How can you bring Illustrator Cs5 layers in Photoshop Cs5?

    Hi everyone, it is possible to bring Illustrator artwork in Photoshop so that the layers in Illustrator are layers in Photoshop, and so that all content is arranged as in Illustrator.

    I did bring in a form or a group of shapes in Photoshop by pasting them into a layer in PS then some bringing more things to another layer in Illustrator and paste into another layer in PS but obviously it is a mission to align new content, so it is organized as if it were in Illustrator first.

    Any help appreciated

    Thank you Gareth

    Save layers
    [...] Select Maximum editability to export transparent objects (in other words, the objects of an opacity mask, a constant opacity less than 100% or a different blending mode than Normal) in the form of live, editable Photoshop layers.

    and don't forget to remove the overprint settings.

  • How to handle large files (3 gb +) in photoshop

    I started the creation of 3 GB + files in photoshop CS2 and my computer takes 3 minutes to open and 10 minutes to record, etc. - drives me crazy with delays. My system (duo core 3,166 mhz, motherboard ASUS P5K SE/EPU, 4 GB Kingston DDR2 800 RAM, videocard Quadro FX540) is doing well with 300 MB of files, but not with them.

    Recently I moved my OS to Windows 7 Professional 64 - bit in the hope that things would improve, but any change was marginal.

    The files are designs multi-layer, 150 dpi, about 16 feet by 10 feet and 1.8 GB flattened when they are printed.

    While I know that the designs are pushing the limits and restrictions of photoshop I would appreciate any opinions of members who have figured out how to handle large files. Any suggestions welcomed, if the upgrades of hardware/software, photoshop tips (but the dpi and size cannot be changed), etc.

    CS2 works on Win7? You run in virtual XP mode?

    I noticed that the flat size is 1.8 G are you save in tiff or psd? If tiff, move on to the DSP. Records room and should open more quickly. At least this is my experience.

  • Can someone tell me how to show/hide multiple layers at the same time?

    Hello

    Can someone show me how to make more than one layer visible or invisible, without having to click on each separate layer? -J' have more than 100 layers in a drawing, and it is very tedious to have to click on each individual layer to hide it or show it. I just started using Photoshop elements 13, on an iMac

    Thanks for any advice.

    You can Option , click on the eye next to the thumbnail icon of the layer to hide all selected layers, but.

    Option , click New to display all layers.

    Order click to change the visibility of the selected layer switch

    To hide multiple layers, select the layers, right-click on one of the eyes, and click hide this layer

    Repeat to repeat the visible layers.

    You can also click on one of the eyes and then drag down or to hide layers and invert to make the visible layers.

  • Photo-&gt; Edit-&gt; open as layers in Photoshop

    Photo-> Edit-> merge into a Panorama in Photoshop

    Photo-> Edit-> HDR Pro in Photoshop

    Photo-> Edit-> open as layers in Photoshop

    all are dimmed.  How can you UN dim them?

    These 3 options need more of a selected image to become active.

  • Impossible to link layers in Photoshop CS

    I have Photoshop CS. In the box showing the layers I've done, is no longer a small control box to the left of each allowing me to link one layer with the other. If I hold the cursor over the symbol in the shape of loop 'link' at the bottom, a "not available" appears. Does anyone know how to get back the link boxes please? Thanks David5119

    Hello

    Looks like you have a version of photoshop cs2 or newer.

    To link layers in photoshop cs2 and more recent versions, the layers that you want to link must be selected first in the layers panel, and then tap the link at the bottom of the layers panel.

    http://help.Adobe.com/en_US/Photoshop/CS/using/WSfd1234e1c4b69f30ea53e41001031ab64-78d2a.h tml

    Just to be sure to check under help > about Photoshop to see which version you have.

  • How do you manage the layers and objects and to rear of the other

    I do not understand how it is possible to have many objects on the stage and be able to handle the motion tweens with each of them, but ALSO to manage the objects are in front and behind them. I have a boot animation and there are many ongoing action, and there are times where I need my guys to be in front of the objects, and the time when they need to be behind.

    I do not know how to handle things regarding the layers and the movements in a way so I can get the items in the order that I need them to be (as the element on which passes in front of the other).

    Someone at - it advice or a way that I can manage my objects and queries and be able to classify them on the stage so that I can arrange things how I need them to be investment and who should be in front of the other objects?

    Yes, if you want to animate 20 items, you must put each item in its own layer. There are a number of ways to make it a little less tedious. For example, if you place each element on the stage, in the same layer, and then name each instance, you can then select all the elements on the stage and then select the Edit menu and then the timeline and finally distribute to layers. This will place each item in a layer newly created at the same position on the stage and then name each layer to match the name of instance for this element.

    To change the Z-order of any given scene element, you can use a number of different methods. One method is to use Actionscript as I mentioned in my last post. ActionScript is the best method if you need to be able to respond to user input and show the changes that cannot be built in animation since the beginning. If you're just showing an animation preset, you can use a number of methods different timeline based.

    In your example, if you want to have a figure to move another object on the stage, you can do that by creating two layers of the same object. One on one with the figure between the two. So that you have the object to move around both in front and behind, the figure. When you want to display the number in front of the object, set the object in the layer that is on top is not not visible. Then you will see only the object that is at the origin and the figure in front of him. How you go about changing the visible property or the alpha property, of this object. You can use keyframes in the timeline panel or the simple ActionScript.

    You want to find a small pool in the basics of Flash or take a book to guide you. There are a number of very good tutorials on the basic available free animation: http://www.gotoandlearn.com, or at a cost: http://www.lynda.com .

  • How to recover a selection of the screen using the tool of cross hatching? S worked on the old pc to control...

    I used to be able to select a piece of the screen using Ctrl-S, how I got a cross-hatch tool (it looks like the Selection tool in Photoshop)

    Please help - lost without this feature!

    Maybe your version of Vista has the Snipping Tool...

    Windows Vista - activate the Vista Snipping Tool
    http://www.PCWorld.com/article/137099/activate_vistas_snipping_tool.html

    Use capture tool to capture screenshots
    http://Windows.Microsoft.com/en-us/Windows-Vista/use-Snipping-Tool-to-capture-screen-shots

    Vista tutorial - How to use the tool captures of Vista
    http://www.Vistax64.com/tutorials/148532-how-use-Snipping-Tool-Vista.html

  • How to handle the null value

    Hi all

    Can someone tell me how to handle null.

    I have a radio button, I need to capture the worth and inspiring I have a search criterion.

    If I select the radio button without problem. If I did not choose the option button it gives me the error.

    OAMessageRadioButtonBean var1 = (OAMessageRadioButtonBean) webBean.findChildRecursive ("job");
    If (var1! = null)
    {
    S1 = var1.getValue (pageContext) m:System.NET.SocketAddress.ToString ();
    }

    Please suggest.

    Kind regards

    Sangu

    S1 = (String) var1. GetValue (PageContext);

Maybe you are looking for