Article View: adobe.scripting.indesign
Article #8971Moving graphics
From: mihak
Date: Mon, 18 Sep 2006 07:18
Date: Mon, 18 Sep 2006 07:18
41 lines
2061 bytes
2061 bytes
Hi, I have a total newcomer question?
I am importing a graphics from a file into the active page. At at least I think so by:
myDoc = app.activeDocument;
myPage =app.activeWindow.activePage
myFile = File("C:/Petka/02okt/TRENUTNI/02kreb.ai")
// .ai, .jpg or .tif
myImage=app.activeWindow.activePage.place(myFile,[100,50]);
// I position the graphics with the frame at 100, 50
geomBounds=myImage.geometricBounds;
// get the coordinates
myImage.move([10,10]); // moving the image
The problem is, that I moved just the image without the frame.
I tried with:
myImage.fit(FitOptions.frameToContent);
but I get error that .fit is not a function which I believe since it seems that I am playing with the image not the pageItem.
I have several questions to you gurus and mothers:
What kind of object have I created by myImage=app.activeWindow.activePage.place(myFile,[100,50]);
Is it image, graphics, pict or pageItem???
Is there a function that would tell you the name of the object you are using? Something like
alert(typeOf(myImage));
//With the response
image (or whatever)
And finally What magic line is it missing in order to move objects with frames??
Thanks to all good souls around,
Miha
PS Oh yes. One more if I may.
In the reference it says that you can move "to" or "by". How to change the following line if one wants to move "by"
myImage.move([10,10]); // moving the image "to" new position
Technical Details
Message-ID:
<3bc1aa75.-1@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news4.google.com!news.glorb.com!newsfeed.kamp.net!newsfeed.kamp.net!news.germany.com!news.isoc.lu!webcrossingShow Full Headers
Complete Article Headers
X-Google-Thread: f939a,f6cff25e097ea658,start X-Google-Attributes: gidf939a,public X-Google-Language: ENGLISH,ASCII-7-bit From: mihak@adobeforums.com Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news4.google.com!news.glorb.com!newsfeed.kamp.net!newsfeed.kamp.net!news.germany.com!news.isoc.lu!webcrossing Newsgroups: adobe.scripting.indesign Subject: Moving graphics Message-ID: <3bc1aa75.-1@webcrossing.la2eafNXanI> Date: Mon, 18 Sep 2006 00:18:40 -0700 Lines: 47 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit