Skip to main content
Known Participant
November 15, 2020
Question

What is the easiest way to draw a rectangle in a script?

  • November 15, 2020
  • 2 replies
  • 883 views

How do I draw a simple rectangle with a colored stroke and a transparent fill?  I could use Mike Hale's DrawShape() function, but isn't there something simpler?  In PhotoShop CC 2021, I draw a rectangle and it gives me the rectangle on a separate layer.  That would be great for my purpose.  The PhotoShop CC JavaScript Referencce document doesn't seem to have anything for creating rectangles, but it's very likely I'm looking in the wrong place.

This topic has been closed for replies.

2 replies

Legend
November 15, 2020
Draw a rectangular selection.
Draw another smaller rectangular selection in subtraction mode. Fill the selection with the color you want.
 
JJMack
Community Expert
Community Expert
November 15, 2020

Set a rectangle selection. add  an artlayet and stroke the selection. It would not be a shape layer like Mike's DrawShape function creates.

JJMack