Copy link to clipboard
Copied
Hi,
I need to check selected Rectangle if it contains Graphic or it's empty and I need to do it by checking selection, but I couldn't find anything helpful in the OMV on the Selection, and none of what I tried works.
if (app.activeDocument.selection[0].child != Graphic)
{
}
Your help is highly appriciated.
Yulia
Copy link to clipboard
Copied
Hi Yuliaart,
Try this:
var s = app.selection[0];
if( s.constructor == Rectangle && !s.graphics.length )
{
alert('No graphics in selected Rectangle');
}
@+
Marc
Copy link to clipboard
Copied
or this:
for (n = 0 ; n < app.selection.length; n++)
{
if(app.selection.graphics.length > 0)
{
make something ...
}
}
rübi
Copy link to clipboard
Copied
Thank you, guys, it works perfectly.
Yulia