Quantcast
Channel: Adobe Community : Popular Discussions - Illustrator Scripting
Viewing all articles
Browse latest Browse all 12845

Grab location and size of guide box

$
0
0

I know how to get the location and size of an object that is selected;

 

var artWidth = artGroup.width;
var artHeight =artGroup.height;
var artLeftPos = artGroup.pos[0];
var artTopPos = artGroup.pos[1];

 

but all of my templates have only one guide box and that guide box is always centered on the artboard but its y position is up or down the center.  Is there any way to have it check if the box has been changed to guides through the View menu. View > Guides > Make Guides is what I'm talking about when it removes the fill and stroke color of your object to make sure that it can be used for sizing and position of your artwork but will not print.  I need something like below that will go through all the path items until the one item that is a guide is found then it makes it the variable myGuideBox for me to grab its size and position so that I can double check it against what the user had originally selected.

 

I read through the object view and the site http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/illustrator/sdk/CC2014/Illustrator% 20Scripting%20Reference%20-%20… but I can't find anything on telling if an object is a guide or not.  If it is not possible that means that I will have to figure out another option and I'm open to ideas.

 

for (i=0;i<docRef.pathItems.length;i++)
{     if (doc.pathItems[i].guide == true);    {         var myGuideBox = doc.pathitems[i];
}//end if
}//end for

 

Thanks in advance for any ideas or pointers that you can give me.


Viewing all articles
Browse latest Browse all 12845

Trending Articles



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