I am trying to move an embedded graphic from its container to another one. Nor duplicate nor move seems to offer such ability.
I wish to avoid place command. I was more trying to re-affect the container's graphic instance.
Any idea ?
Select the frame that is holding your portrait image.
Shift click the other graphic frame to add it to the selection and run this snippet:
var graphic = app.selection.graphics;
var target = app.selection;
I gave contentPlace a try before I post there and couldn't get it to work. Obviously I was misusing it !
well, sometimes DOM documentation is a bit misleading 😉
Example: You'll find contentPlace() also with [object Group], but I could not find a way yet to contentPlace an object directly as member of a group. An error will be thrown if you try.
Also: If you feed contentPlace() with more than one object in the array the objects will not be placed inside the target, but directly on the spread of the target. Stacked to and distanced from each other. Where the distance follows a rule that I still have to figure out.
Example where the source is on spread 1 and the target is on spread 2:
var doc = app.documents;
var arrayToPlace = doc.spreads.pages.allPageItems;
var target = doc.spreads.pages.pageItems;
var result = target.contentPlace(arrayToPlace);
Result after running the snippet:
And in this case no error message is thrown…
Just an example…
Nice to know