Looks like the result of the "place()" method is an array. A one-item array, so the image is going to be myGraphic. To get the frame that contains myGraphic, ask for the "parent". Thus:
myGraphic.parent.geometricBounds = ["6p", "2.4p", "129p", "63.4p"];
Some advice you didn't ask for: If this script is going to be used by others, think about what happens if someone accidentally chooses something other than a graphic file at File.openDialog. You can add a filter to that command so that only specified file types are displayed.
Hope this helps.
for x, y cordinate you can use move(), like this,
and you can set gb of image and parent as well,
myGraphic.geometricBounds = ["60", "20", "129", "63"];
myGraphic.parent.geometricBounds = ["60", "20", "129", "63"];
Hi payalm68947498 ,
FWIW: Method move() with page items has two arguments.
The first one is to and the second one is by.
Both should be expressed as an array of [ x , y ] values.
If you want to move an object to a position use:
pageItem.move( [ x , y ] )
If you want to move an object by an amount of values:
pageItem.move( undefined , [ x , y ] )
It worked it moved it to where I need it to go.
How to I get the graphic to fit...Content to Frame?
Plus, how do I set up the filters to only allow certain files?
Thanks so much for your help.
I greatly appreciate it..
I didn't know the correct terms to use.
How do I scale the graphic once it moved into place.
I need it to Fit Content to Frame...but not sure of the terms to use.
use fit to frame option,
1 person found this helpful
check DOM documentation for InDesign.
For CS6 and below I recommend Jongware's here:
With CC 2018 look into Gregor Fellenz' there:
You'll find all available methods, properties and objects.
E.g. with TextFrame and its method fit() :