Skip to main content
Participant
January 21, 2014
Answered

Can I select non-rectangular regions / arrays using a script?

  • January 21, 2014
  • 2 replies
  • 703 views

I took at look at the VB Scripting Reference. Not clear whether the Select-Region made up of an array of points, can in fact be something other than a rectangle.

This topic has been closed for replies.
Correct answer Chuck Uebele

I'm not familar with VB, and most people who script tend to use JS, as it's cross platform.  However, with js, and I'm assuming VB you can set an array of points for a selection, and it doesn't have to be a rectangle.  the Select-Region might be just for a retangular area, but you should be able to create a selection in any shape you want.

2 replies

pixxxelschubser
Community Expert
Community Expert
January 21, 2014

Hi sharmon94,

I'm not familar with VB.

But here is an example in JS.

// SelectRegion.jsx

app.preferences.rulerUnits = Units.PIXELS; 

var aDoc = app.documents.add (500, 500) ;

aDoc.selection.select ([ [0, 0], [50, 150], [200, 300], [350, 50], [500, 450], [200, 400], [50, 500] ]);

Perhaps this helps you a little bit.

Have fun

Chuck Uebele
Community Expert
Chuck UebeleCommunity ExpertCorrect answer
Community Expert
January 21, 2014

I'm not familar with VB, and most people who script tend to use JS, as it's cross platform.  However, with js, and I'm assuming VB you can set an array of points for a selection, and it doesn't have to be a rectangle.  the Select-Region might be just for a retangular area, but you should be able to create a selection in any shape you want.

sharmon94Author
Participant
January 21, 2014

Thank you very much.