Copy link to clipboard
Copied
I do a process where I place rectangular shapes around certain images, these images are always four-sided, usually squares or rectangles, but they are always different, so I keep having to make a new frame around it every time.
The reason why I can't just have the frame made beforehand and just resize it to the new image is because I need the frame to maintain its original ratio, that being, its height in the horizontal parts and its width in the vertical part, the frame needs to keep the same border size and resizing would change that.
My document has a folder containing the separate rectangular shapes that I use to make new shapes each time.
The lenght of the frame should be a full white 43px rectangular. And later when I merge all the rectangles to form the full frame and I also add a black shape stroke of 10px. This stroke is the one found in the shape menu instead of the layer style stroke as they produce different results.
I'm wondering if it's possible to create a script that does the following:
> Create four 43px sized white shape squares.
> Resposition them to be on the 4 borders of the layer that was selected beforehand.
> Resize all of them to have the respective same size as the borders of the original layer they are supposed to be on.
> Merge them all together in one single shape.
> Add a black shape stroke of 10px. (Not to be confused with the Layer Style Stroke)
>Finish with the Frame above the image on the Layers visibility Panel.
@HeyoThere – Try this script:
/*
Create Frame Around Layer Image.jsx
v1.1 - 15th October 2023, Stephen Marsh
https://community.adobe.com/t5/photoshop-ecosystem-discussions/how-do-i-automatically-create-a-shape-frame-around-an-image/td-p/14157861
Info: This script will add a layer group and a black/white/black frame around the target layer
*/
var origRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
var layerBounds = activeDocument.activeLayer.bounds;
makeGro
...
Copy link to clipboard
Copied
You should be able to do this via an action. Is this for single image/layer files? Is the layer bounds always smaller than the canvas size? Or will the layer/image sometimes be the same size as the canvas and flattened?
To be crystal clear, please upload before and after layered PSD files.
Copy link to clipboard
Copied
> Is this for single image/layer files?
The file should have multiple layers, but the frame should added to one layer per time, I may do it more than one time per file though, not sure if it's an issue.
> Is the layer bounds always smaller than the canvas size?
Yes, always smaller than the canvas.
Can an action resize shapes to different sizes each time? I'm sending an example, but the problem is that the rectangle should be different every time, could even be a square. If an action can do that it's perfect for me. If so I may need to learn how to set up such an action to resize the image like that.
I'm sending one file with all the operations I described on my first comment with one blank layer describing what's being done.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
It seems to be an easier process than what I came up with. It achieves the perfect 90° black stroke both on the inside and outside of the frame. It looks exactly like what I want. As long as it centralizes perfectly with whatever image I'm using seems to be a perfect alternative.
I do think it would be good if the frame end result was pixel perfect, both the white part and the black stroke, if possible, of course.
Copy link to clipboard
Copied
Trying to create a border and drop shadow around my paintings for a portfolio. Using photoshop on my iPad . Any suggestion on how to keep
it all consistent?
Copy link to clipboard
Copied
@amy_7668 – Sorry, I don’t use the iPad version and my understanding is that it's quite limited compared to the desktop version being discussed above.
Copy link to clipboard
Copied
@HeyoThere – Try this script:
/*
Create Frame Around Layer Image.jsx
v1.1 - 15th October 2023, Stephen Marsh
https://community.adobe.com/t5/photoshop-ecosystem-discussions/how-do-i-automatically-create-a-shape-frame-around-an-image/td-p/14157861
Info: This script will add a layer group and a black/white/black frame around the target layer
*/
var origRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
var layerBounds = activeDocument.activeLayer.bounds;
makeGroupFromLayers(activeDocument.activeLayer.name + " Frame");
makeRectangleShapeLayer(0, 0, 0, true, false, 53, 0, 0, 0);
activeDocument.activeLayer.name = "Black Double Stroke Frame"
makeRectangleShapeLayer(0, 0, 0, true, false, 33, 255, 255, 255);
activeDocument.activeLayer.name = "White Fill Frame"
app.preferences.rulerUnits = origRulerUnits;
///// FUNCTIONS /////
function makeRectangleShapeLayer(fillR, fillG, fillB, strokeEnabled, fillEnabled, strokeValue, strokeR, strokeG, strokeB) {
var idmake = stringIDToTypeID( "make" );
var desc238 = new ActionDescriptor();
var idnull = stringIDToTypeID( "null" );
var ref28 = new ActionReference();
var idcontentLayer = stringIDToTypeID( "contentLayer" );
ref28.putClass( idcontentLayer );
desc238.putReference( idnull, ref28 );
var idusing = stringIDToTypeID( "using" );
var desc239 = new ActionDescriptor();
var idtype = stringIDToTypeID( "type" );
var desc240 = new ActionDescriptor();
var idcolor = stringIDToTypeID( "color" );
var desc241 = new ActionDescriptor();
var idred = stringIDToTypeID( "red" );
desc241.putDouble( idred, fillR );
var idgrain = stringIDToTypeID( "grain" );
desc241.putDouble( idgrain, fillG );
var idblue = stringIDToTypeID( "blue" );
desc241.putDouble( idblue, fillB );
var idRGBColor = stringIDToTypeID( "RGBColor" );
desc240.putObject( idcolor, idRGBColor, desc241 );
var idsolidColorLayer = stringIDToTypeID( "solidColorLayer" );
desc239.putObject( idtype, idsolidColorLayer, desc240 );
var idshape = stringIDToTypeID( "shape" );
var desc242 = new ActionDescriptor();
var idunitValueQuadVersion = stringIDToTypeID( "unitValueQuadVersion" );
desc242.putInteger( idunitValueQuadVersion, 1 );
var idtop = stringIDToTypeID( "top" );
var idpixelsUnit = stringIDToTypeID( "pixelsUnit" );
desc242.putUnitDouble( idtop, idpixelsUnit, layerBounds[1].value );
var idleft = stringIDToTypeID( "left" );
var idpixelsUnit = stringIDToTypeID( "pixelsUnit" );
desc242.putUnitDouble( idleft, idpixelsUnit, layerBounds[0].value );
var idbottom = stringIDToTypeID( "bottom" );
var idpixelsUnit = stringIDToTypeID( "pixelsUnit" );
desc242.putUnitDouble( idbottom, idpixelsUnit, layerBounds[3].value );
var idright = stringIDToTypeID( "right" );
var idpixelsUnit = stringIDToTypeID( "pixelsUnit" );
desc242.putUnitDouble( idright, idpixelsUnit, layerBounds[2].value );
var idtopRight = stringIDToTypeID( "topRight" );
var idpixelsUnit = stringIDToTypeID( "pixelsUnit" );
desc242.putUnitDouble( idtopRight, idpixelsUnit, 0.000000 );
var idtopLeft = stringIDToTypeID( "topLeft" );
var idpixelsUnit = stringIDToTypeID( "pixelsUnit" );
desc242.putUnitDouble( idtopLeft, idpixelsUnit, 0.000000 );
var idbottomLeft = stringIDToTypeID( "bottomLeft" );
var idpixelsUnit = stringIDToTypeID( "pixelsUnit" );
desc242.putUnitDouble( idbottomLeft, idpixelsUnit, 0.000000 );
var idbottomRight = stringIDToTypeID( "bottomRight" );
var idpixelsUnit = stringIDToTypeID( "pixelsUnit" );
desc242.putUnitDouble( idbottomRight, idpixelsUnit, 0.000000 );
var idrectangle = stringIDToTypeID( "rectangle" );
desc239.putObject( idshape, idrectangle, desc242 );
var idstrokeStyle = stringIDToTypeID( "strokeStyle" );
var desc243 = new ActionDescriptor();
var idstrokeStyleVersion = stringIDToTypeID( "strokeStyleVersion" );
desc243.putInteger( idstrokeStyleVersion, 2 );
var idstrokeEnabled = stringIDToTypeID( "strokeEnabled" );
desc243.putBoolean( idstrokeEnabled, strokeEnabled );
var idfillEnabled = stringIDToTypeID( "fillEnabled" );
desc243.putBoolean( idfillEnabled, fillEnabled );
var idstrokeStyleLineWidth = stringIDToTypeID( "strokeStyleLineWidth" );
var idpixelsUnit = stringIDToTypeID( "pixelsUnit" );
desc243.putUnitDouble( idstrokeStyleLineWidth, idpixelsUnit, strokeValue );
var idstrokeStyleLineDashOffset = stringIDToTypeID( "strokeStyleLineDashOffset" );
var idpointsUnit = stringIDToTypeID( "pointsUnit" );
desc243.putUnitDouble( idstrokeStyleLineDashOffset, idpointsUnit, 0.000000 );
var idstrokeStyleMiterLimit = stringIDToTypeID( "strokeStyleMiterLimit" );
desc243.putDouble( idstrokeStyleMiterLimit, 100.000000 );
var idstrokeStyleLineCapType = stringIDToTypeID( "strokeStyleLineCapType" );
var idstrokeStyleLineCapType = stringIDToTypeID( "strokeStyleLineCapType" );
var idstrokeStyleButtCap = stringIDToTypeID( "strokeStyleButtCap" );
desc243.putEnumerated( idstrokeStyleLineCapType, idstrokeStyleLineCapType, idstrokeStyleButtCap );
var idstrokeStyleLineJoinType = stringIDToTypeID( "strokeStyleLineJoinType" );
var idstrokeStyleLineJoinType = stringIDToTypeID( "strokeStyleLineJoinType" );
var idstrokeStyleMiterJoin = stringIDToTypeID( "strokeStyleMiterJoin" );
desc243.putEnumerated( idstrokeStyleLineJoinType, idstrokeStyleLineJoinType, idstrokeStyleMiterJoin );
var idstrokeStyleLineAlignment = stringIDToTypeID( "strokeStyleLineAlignment" );
var idstrokeStyleLineAlignment = stringIDToTypeID( "strokeStyleLineAlignment" );
var idstrokeStyleAlignCenter = stringIDToTypeID( "strokeStyleAlignCenter" );
desc243.putEnumerated( idstrokeStyleLineAlignment, idstrokeStyleLineAlignment, idstrokeStyleAlignCenter );
var idstrokeStyleScaleLock = stringIDToTypeID( "strokeStyleScaleLock" );
desc243.putBoolean( idstrokeStyleScaleLock, false );
var idstrokeStyleStrokeAdjust = stringIDToTypeID( "strokeStyleStrokeAdjust" );
desc243.putBoolean( idstrokeStyleStrokeAdjust, false );
var idstrokeStyleLineDashSet = stringIDToTypeID( "strokeStyleLineDashSet" );
var list7 = new ActionList();
desc243.putList( idstrokeStyleLineDashSet, list7 );
var idstrokeStyleBlendMode = stringIDToTypeID( "strokeStyleBlendMode" );
var idblendMode = stringIDToTypeID( "blendMode" );
var idnormal = stringIDToTypeID( "normal" );
desc243.putEnumerated( idstrokeStyleBlendMode, idblendMode, idnormal );
var idstrokeStyleOpacity = stringIDToTypeID( "strokeStyleOpacity" );
var idpercentUnit = stringIDToTypeID( "percentUnit" );
desc243.putUnitDouble( idstrokeStyleOpacity, idpercentUnit, 100.000000 );
var idstrokeStyleContent = stringIDToTypeID( "strokeStyleContent" );
var desc244 = new ActionDescriptor();
var idcolor = stringIDToTypeID( "color" );
var desc245 = new ActionDescriptor();
var idred = stringIDToTypeID( "red" );
desc245.putDouble( idred, strokeR );
var idgrain = stringIDToTypeID( "grain" );
desc245.putDouble( idgrain, strokeG );
var idblue = stringIDToTypeID( "blue" );
desc245.putDouble( idblue, strokeB );
var idRGBColor = stringIDToTypeID( "RGBColor" );
desc244.putObject( idcolor, idRGBColor, desc245 );
var idsolidColorLayer = stringIDToTypeID( "solidColorLayer" );
desc243.putObject( idstrokeStyleContent, idsolidColorLayer, desc244 );
var idstrokeStyleResolution = stringIDToTypeID( "strokeStyleResolution" );
desc243.putDouble( idstrokeStyleResolution, 72.000000 );
var idstrokeStyle = stringIDToTypeID( "strokeStyle" );
desc239.putObject( idstrokeStyle, idstrokeStyle, desc243 );
var idcontentLayer = stringIDToTypeID( "contentLayer" );
desc238.putObject( idusing, idcontentLayer, desc239 );
executeAction( idmake, desc238, DialogModes.NO );
}
function makeGroupFromLayers(theName) {
function s2t(s) {
return app.stringIDToTypeID(s);
}
var descriptor = new ActionDescriptor();
var descriptor2 = new ActionDescriptor();
var reference = new ActionReference();
var reference2 = new ActionReference();
reference.putClass( s2t( "layerSection" ));
descriptor.putReference( s2t( "null" ), reference );
reference2.putEnumerated( s2t( "layer" ), s2t( "ordinal" ), s2t( "targetEnum" ));
descriptor.putReference( s2t( "from" ), reference2 );
descriptor2.putString( s2t( "name" ), theName );
descriptor.putObject( s2t( "using" ), s2t( "layerSection" ), descriptor2 );
executeAction( s2t( "make" ), descriptor, DialogModes.NO );
}
https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html
Copy link to clipboard
Copied
The script is working really well, it does exactly what I had envisioned. Upon a few tests I noticed that the end result is a frame with a length of 36px, my frames always end up with a length of 53px, considering the stroke. I tried taking a look at the code to see if it was easy to control the end result of the frame and couldn't find any easy way to control it.
Is it possible to make the final length 53px instead of 36 and furthermore, is it possible to make a way to control this end result in case there's ever a necessity to change it? An easy to modify variable of both the white part and the black outline? Aside from that the code is pretty much what I wanted.
Copy link to clipboard
Copied
The upper frame is your original sample, the lower image at 50% opacity is the result of the script:
The black stroke value is 35:
makeRectangleShapeLayer(0, 0, 0, true, false, 35, 0, 0, 0);
The white value is 22:
makeRectangleShapeLayer(0, 0, 0, true, false, 22, 255, 255, 255);
EDIT: OK, I can see the difference in your later example file "All Operations.psd"... I'll need to see what is possible.
Copy link to clipboard
Copied
Weird. Did I do something wrong?
Here's my original result compared with the result with the script in 50% opacity.
In your image, it seems to have the exact same measure. But in mine it's way thinner and the same 36px of before. I added the script on Notepad+ saved the file as jsx and then I ran on Photoshop. Is there any step I did wrong? I tried changing the version of Photoshop to the newest but nothing changed.
I'm sending a psd file with my version of the script so you can take a look. I really wanted the frame to have the exact measure of the original
Copy link to clipboard
Copied
It's probably something I did, I'll see if I can make revisions to the current code without starting again from scratch...
Copy link to clipboard
Copied
I did some trial and error and I think I found something really close, it's has one-pixel difference from the original, my original having 53px and this one having 54px.
These were the values I used:
makeRectangleShapeLayer(0, 0, 0, true, false, 53, 0, 0, 0);
activeDocument.activeLayer.name = "Black Double Stroke Frame"
makeRectangleShapeLayer(0, 0, 0, true, false, 33, 255, 255, 255);
I think as it is it seems to work really well. I did noticed that the frame ends up a bit bigger than the my original frame, though that shouldn't be a problem, and also on weird grey black pixels on the the border of the black stroke part. But checking on the renderized image it's unnoticeable, so it wouldn't be a problem as well. I think as it is it looks really good. Can you confirm if the values I added are correct and if I didn't do anything wrong that will break the code?
Copy link to clipboard
Copied
If you're happy, I'm happy! :]
I'm not getting the same results with the updated stroke thickness values compared to your last layered sample image "All Operations.psd".
I'm now looking at breaking the strokes into 3, rather than 2.
This could also be due to the stroke alignment outer/centre/inner which I haven't explicitly set in the script and could be different on your system than mine which is set to align to centre of the rectangle path.
Copy link to clipboard
Copied
Upon more testing I noticed one potential problem, on the final part of the script it moves the folder containing the frame and the image to the top of the layer channels I'm not sure if this was a result of the last thing I requested, but in case it is, I meant the frame should be above the image and this happens naturally. I do like that it gets sorted in a folder, but is it possible for this folder to continue in the same place the original image was. Basically my document has many layers so having to move it back is a bit annoying
Copy link to clipboard
Copied
@HeyoThere wrote:
Upon more testing I noticed one potential problem, on the final part of the script it moves the folder containing the frame and the image to the top of the layer
That was an inadvertent side effect of using DOM code to create the group/set, I'll quickly fix that up with AM code...
@HeyoThere – I have updated the code to a 1.1 version which should retain the layer stack position when the selected layer is converted to a group.
Copy link to clipboard
Copied
So the code should be doing exactly what I need, and for that I have to thank you a lot. You helped save a lot of time, thank you for the big help again!
Copy link to clipboard
Copied
So the code should be doing exactly what I need, and for that I have to thank you a lot. You helped save a lot of time, thank you for the big help again!
By @HeyoThere
Thank you! You're welcome. So you know how to adjust the thickness of the stroke.
The rectangle is using the bounding area of the original layer, which you can reference in the Properties panel.
As I wrote before, I started working on adding three separate rectangles, which can be adjusted from the original size and position.
I'll post the work-in-progress function that I was modifying as a backup, as I see no need to work on this further if you are happy.
makeRectangleShapeLayer(0, 0, 0, layerBounds[1].value, layerBounds[0].value, layerBounds[3].value, layerBounds[2].value, true, false, 10, 0, 0, 0);
activeDocument.activeLayer.name = "Black Outer Frame"
makeRectangleShapeLayer(0, 0, 0, layerBounds[1].value +24, layerBounds[0].value +24, layerBounds[3].value -24, layerBounds[2].value -24, true, false, 36, 255, 255, 255);
activeDocument.activeLayer.name = "White Centre Frame"
makeRectangleShapeLayer(0, 0, 0, layerBounds[1].value +44, layerBounds[0].value +44, layerBounds[3].value -44, layerBounds[2].value -44, true, false, 10, 0, 0, 0);
activeDocument.activeLayer.name = "Black Inner Frame"
function makeRectangleShapeLayer(fillR, fillG, fillB, layerBounds1, layerBounds0, layerBounds3, layerBounds2, strokeEnabled, fillEnabled, strokeValue, strokeR, strokeG, strokeB) {
var idmake = stringIDToTypeID( "make" );
var desc238 = new ActionDescriptor();
var idnull = stringIDToTypeID( "null" );
var ref28 = new ActionReference();
var idcontentLayer = stringIDToTypeID( "contentLayer" );
ref28.putClass( idcontentLayer );
desc238.putReference( idnull, ref28 );
var idusing = stringIDToTypeID( "using" );
var desc239 = new ActionDescriptor();
var idtype = stringIDToTypeID( "type" );
var desc240 = new ActionDescriptor();
var idcolor = stringIDToTypeID( "color" );
var desc241 = new ActionDescriptor();
var idred = stringIDToTypeID( "red" );
desc241.putDouble( idred, fillR );
var idgrain = stringIDToTypeID( "grain" );
desc241.putDouble( idgrain, fillG );
var idblue = stringIDToTypeID( "blue" );
desc241.putDouble( idblue, fillB );
var idRGBColor = stringIDToTypeID( "RGBColor" );
desc240.putObject( idcolor, idRGBColor, desc241 );
var idsolidColorLayer = stringIDToTypeID( "solidColorLayer" );
desc239.putObject( idtype, idsolidColorLayer, desc240 );
var idshape = stringIDToTypeID( "shape" );
var desc242 = new ActionDescriptor();
var idunitValueQuadVersion = stringIDToTypeID( "unitValueQuadVersion" );
desc242.putInteger( idunitValueQuadVersion, 1 );
var idtop = stringIDToTypeID( "top" );
var idpixelsUnit = stringIDToTypeID( "pixelsUnit" );
desc242.putUnitDouble( idtop, idpixelsUnit, layerBounds1 );
var idleft = stringIDToTypeID( "left" );
var idpixelsUnit = stringIDToTypeID( "pixelsUnit" );
desc242.putUnitDouble( idleft, idpixelsUnit, layerBounds0 );
var idbottom = stringIDToTypeID( "bottom" );
var idpixelsUnit = stringIDToTypeID( "pixelsUnit" );
desc242.putUnitDouble( idbottom, idpixelsUnit, layerBounds3 );
var idright = stringIDToTypeID( "right" );
var idpixelsUnit = stringIDToTypeID( "pixelsUnit" );
desc242.putUnitDouble( idright, idpixelsUnit, layerBounds2 );
var idtopRight = stringIDToTypeID( "topRight" );
var idpixelsUnit = stringIDToTypeID( "pixelsUnit" );
desc242.putUnitDouble( idtopRight, idpixelsUnit, 0.000000 );
var idtopLeft = stringIDToTypeID( "topLeft" );
var idpixelsUnit = stringIDToTypeID( "pixelsUnit" );
desc242.putUnitDouble( idtopLeft, idpixelsUnit, 0.000000 );
var idbottomLeft = stringIDToTypeID( "bottomLeft" );
var idpixelsUnit = stringIDToTypeID( "pixelsUnit" );
desc242.putUnitDouble( idbottomLeft, idpixelsUnit, 0.000000 );
var idbottomRight = stringIDToTypeID( "bottomRight" );
var idpixelsUnit = stringIDToTypeID( "pixelsUnit" );
desc242.putUnitDouble( idbottomRight, idpixelsUnit, 0.000000 );
var idrectangle = stringIDToTypeID( "rectangle" );
desc239.putObject( idshape, idrectangle, desc242 );
var idstrokeStyle = stringIDToTypeID( "strokeStyle" );
var desc243 = new ActionDescriptor();
var idstrokeStyleVersion = stringIDToTypeID( "strokeStyleVersion" );
desc243.putInteger( idstrokeStyleVersion, 2 );
var idstrokeEnabled = stringIDToTypeID( "strokeEnabled" );
desc243.putBoolean( idstrokeEnabled, strokeEnabled );
var idfillEnabled = stringIDToTypeID( "fillEnabled" );
desc243.putBoolean( idfillEnabled, fillEnabled );
var idstrokeStyleLineWidth = stringIDToTypeID( "strokeStyleLineWidth" );
var idpixelsUnit = stringIDToTypeID( "pixelsUnit" );
desc243.putUnitDouble( idstrokeStyleLineWidth, idpixelsUnit, strokeValue );
var idstrokeStyleLineDashOffset = stringIDToTypeID( "strokeStyleLineDashOffset" );
var idpointsUnit = stringIDToTypeID( "pointsUnit" );
desc243.putUnitDouble( idstrokeStyleLineDashOffset, idpointsUnit, 0.000000 );
var idstrokeStyleMiterLimit = stringIDToTypeID( "strokeStyleMiterLimit" );
desc243.putDouble( idstrokeStyleMiterLimit, 100.000000 );
var idstrokeStyleLineCapType = stringIDToTypeID( "strokeStyleLineCapType" );
var idstrokeStyleLineCapType = stringIDToTypeID( "strokeStyleLineCapType" );
var idstrokeStyleButtCap = stringIDToTypeID( "strokeStyleButtCap" );
desc243.putEnumerated( idstrokeStyleLineCapType, idstrokeStyleLineCapType, idstrokeStyleButtCap );
var idstrokeStyleLineJoinType = stringIDToTypeID( "strokeStyleLineJoinType" );
var idstrokeStyleLineJoinType = stringIDToTypeID( "strokeStyleLineJoinType" );
var idstrokeStyleMiterJoin = stringIDToTypeID( "strokeStyleMiterJoin" );
desc243.putEnumerated( idstrokeStyleLineJoinType, idstrokeStyleLineJoinType, idstrokeStyleMiterJoin );
var idstrokeStyleLineAlignment = stringIDToTypeID( "strokeStyleLineAlignment" );
var idstrokeStyleLineAlignment = stringIDToTypeID( "strokeStyleLineAlignment" );
var idstrokeStyleAlignCenter = stringIDToTypeID( "strokeStyleAlignCenter" );
desc243.putEnumerated( idstrokeStyleLineAlignment, idstrokeStyleLineAlignment, idstrokeStyleAlignCenter );
var idstrokeStyleScaleLock = stringIDToTypeID( "strokeStyleScaleLock" );
desc243.putBoolean( idstrokeStyleScaleLock, false );
var idstrokeStyleStrokeAdjust = stringIDToTypeID( "strokeStyleStrokeAdjust" );
desc243.putBoolean( idstrokeStyleStrokeAdjust, false );
var idstrokeStyleLineDashSet = stringIDToTypeID( "strokeStyleLineDashSet" );
var list7 = new ActionList();
desc243.putList( idstrokeStyleLineDashSet, list7 );
var idstrokeStyleBlendMode = stringIDToTypeID( "strokeStyleBlendMode" );
var idblendMode = stringIDToTypeID( "blendMode" );
var idnormal = stringIDToTypeID( "normal" );
desc243.putEnumerated( idstrokeStyleBlendMode, idblendMode, idnormal );
var idstrokeStyleOpacity = stringIDToTypeID( "strokeStyleOpacity" );
var idpercentUnit = stringIDToTypeID( "percentUnit" );
desc243.putUnitDouble( idstrokeStyleOpacity, idpercentUnit, 100.000000 );
var idstrokeStyleContent = stringIDToTypeID( "strokeStyleContent" );
var desc244 = new ActionDescriptor();
var idcolor = stringIDToTypeID( "color" );
var desc245 = new ActionDescriptor();
var idred = stringIDToTypeID( "red" );
desc245.putDouble( idred, strokeR );
var idgrain = stringIDToTypeID( "grain" );
desc245.putDouble( idgrain, strokeG );
var idblue = stringIDToTypeID( "blue" );
desc245.putDouble( idblue, strokeB );
var idRGBColor = stringIDToTypeID( "RGBColor" );
desc244.putObject( idcolor, idRGBColor, desc245 );
var idsolidColorLayer = stringIDToTypeID( "solidColorLayer" );
desc243.putObject( idstrokeStyleContent, idsolidColorLayer, desc244 );
var idstrokeStyleResolution = stringIDToTypeID( "strokeStyleResolution" );
desc243.putDouble( idstrokeStyleResolution, 72.000000 );
var idstrokeStyle = stringIDToTypeID( "strokeStyle" );
desc239.putObject( idstrokeStyle, idstrokeStyle, desc243 );
var idcontentLayer = stringIDToTypeID( "contentLayer" );
desc238.putObject( idusing, idcontentLayer, desc239 );
executeAction( idmake, desc238, DialogModes.NO );
}
//////////
//
// layerBounds:
// + - - - - - - - [1] - - - - - - - +
// | |
// | |
// [0] [2]
// | |
// | |
// + - - - - - - - [3] - - - - - - - +
//
//////////