A Script to Align Dashed Strokes to Corners in Photoshop

It’s not hard to create dashed line effects in Photoshop. Just use one of the shape tools or the Line tool and apply a dashed stroke in the Options bar or Properties panel.

Photoshop stroke options

Click More Options to customize the stroke pattern and save it, if you wish.

saving a custom stroke pattern in Photoshop

So far, so good. But you may run into difficulty if you have a shape with corners. Photoshop does not have a feature like InDesign and Illustrator do for automatically adjusting the dash pattern to make corners look consistent.

Photoshop dashed corners problem

These are not the corners you’re looking for.

Ordinarily, you have keep monkeying with the shape, its stroke width, and/or the dash and gap values to prevent sloppy-looking corners. This is not how you want to spend your day.

Instead, enlist the help of a free script created by David Jensen way back in 2012. Originally written for CS6, it still works just fine today. Put the script file in your Presets > Scripts folder, and restart Photoshop.

On the Layers panel, select the layer containing the shape with the dashed stroke. Choose File > Scripts > Dashed Line Nice Corners.

In the script’s dialog box, use the Pattern and Multiplier settings to tweak your dashes and gaps. There’s no documentation to explain exactly how they work, but you’ll get the hang of it pretty quickly by experimenting with different values.

And, in a very nice touch, the dialog box also includes an Apply button so you can experiment with different values till you get the look you want. You can also simply re-run the script if you want to change the effect at any time after applying it.

This script may be a decade old but it’s still quite useful and works like charm. Thanks, David!

Editor in Chief of CreativePro. Instructor at LinkedIn Learning with courses on InDesign, Illustrator, Photoshop, GIMP, Inkscape, and Affinity Publisher.
>