Quantcast
Channel: Adobe Community : Popular Discussions - Photoshop Scripting
Viewing all articles
Browse latest Browse all 12244

Not able to use the Documento.selection.select() function

$
0
0

Hi friends

 

I want to make a selection that takes more or less 1/7 of the height of the active document (see the attached image, the white portion is the simulation of the region).

 

So I thought I could use the app.activeDocument.selection.select(region) function. In the manual, the "region" parameter is an array of numbers. So I wrote this:

 

app.preferences.rulerUnits = Units.PIXELS;   

var doc = app.activeDocument;

   

var sizeH = new Number (doc.height - Math.round(doc.height /7));

var totalW = new Number (doc.width);

var totalH = new Number (doc.height);  

   

var coord = new Array (0, sizeH, totalW, totalH);

alert(coord) >> it´s an array of numbers;

   

doc.selection.select (coord);

 

But ExtendedScript is returing "Invalid argument" in the last line. So it´s not accepting "coord".

 

What Am I missing?

 

Thank you very much for the help

Best Regards

Gustavo.


Viewing all articles
Browse latest Browse all 12244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>