![]() ![]() Deselect all layers with Action ManagerĮxecuteAction (ID ("selectNoLayers"), NAD, DialogModes. Delete temporary group with Action ManagerĮxecuteAction (ID ("ungroupLayersEvent"), NAD, DialogModes.NO) (NAR = new ActionReference ()).putName (ID ("layer"), "Temporary_Group") ĮxecuteAction (ID ("select"), NAD, DialogModes.NO) Select temporary group with Action Manager NAD.putObject (ID ("using"), ID ( "layerSection" ), NAR3) ĮxecuteAction (ID ("make"), NAD, DialogModes.NO) (NAR3 = new ActionDescriptor ()).putString (ID ("name"), """Temporary_Group""") (NAR2 = new ActionReference ()).putEnumerated (ID ("layer"), ID ("ordinal"), ID ("targetEnum")) (NAR = new ActionReference ()).putClass (ID ("layerSection")) Alternatively, you can reach for it in the menu by going to Edit > Free Transform. Hit Cmd+T Ctrl+T to activate the Free Transform function. Group selected layers with Action Manager Here’s how to go about resizing a layer: Select the layer you want to resize. (NAD = new ActionDescriptor ()).putReference (ID ("null"), NAR) ĮxecuteAction (ID ("selectAllLayers"), NAD, DialogModes.NO) (NAR = new ActionReference ()).putEnumerated (ID ("layer"), ID ("ordinal"), ID ("targetEnum")) The final code is the seguent: var Document = app.activeDocument Since I wasn't able to resolve, I ultimately opted to group the layers and ungroup them once the resizing was done. I have already tried to replace activeLayer with layers or artLayers, but I get "Error 1302: No such element" and I don't know how to address the problem. This is 'Adobe Photoshop - resizing a layer and its path outline.' by Ben Halsall on Vimeo, the home for high quality videos and the people. The Free Transform Tool is probably the most common method used for resizing an image, easy to access and allows the editor to work with individual layers. What I want to do is resize all the layers together so that they can keep the same aspect ratio between each other, so i can't resize with a loop or the proportions would be lost by transforming all layers to the same size as the canvas.ĭo you have any ideas how this could be done? NAD.putReference (charIDToTypeID ("null"), NAR) ĮxecuteAction (stringIDToTypeID ("selectAllLayers"), NAD, DialogModes.NO) NAR.putEnumerated (charIDToTypeID ("Lyr "), charIDToTypeID ("Ordn"), charIDToTypeID ("Trgt")) I'm trying to integrate the seguent piece of code that selects all the layers: var NAD = new ActionDescriptor () To resize a layer or a selected object within a layer, select Transform from the Edit menu and click Scale. The problem is that it only resizes the active layer. Var BND = ĭ ((Document.width / IWidth * 100), (Document.width / IWidth * 100), AnchorPosition.MIDDLECENTER) ĭ ((Document.height / IHeight * 100), (Document.height / IHeight * 100), AnchorPosition.MIDDLECENTER) The code is the seguent: var Document = app.activeDocument Just click and drag inside the bounding box to reposition the object. You may have to reposition the object as well. ![]() The selection will resize proportionately as you drag. To resize, grab any of the little square-shaped handles and drag. I have a script on Photoshop that allows me to resize a layer to the image bounds while maintaining the proportions. A blue bounding box will appear around your selection. ![]()
0 Comments
Leave a Reply. |