Copy link to clipboard
Copied
Hi,
I want to take a graphic that is in a separate (labeled) graphic frame and move it within some text as an anchored object.
I can do this easily by geting the link from the image and placing it at my insertion point.
var myImage = app.documents[0].pageItems.item("photo1").images[0];
myInsertionPoint.place(myImage.itemLink.filePath);
BUT how do I do this if my original graphic is embedded and the linked file no longer available?
Do I have to unembed thegraphic to a temporary location, use my script above and then embed and remove the original or is there a simpler way?
I expect to be told that I shouldn't be embedding graphics but this what I have to work with.
Thanks
Simon Kemp.
Copy link to clipboard
Copied
You can export it as a snippet, or library asset.
Harbs
Copy link to clipboard
Copied
OK, that approach makes sense, thanks.
However, I cannot find any method for exporting snippets in the ESTK Object Model Viewer or if I search this forum.
Is this obvious or can you give me an example.
Thanks
Simon.
Copy link to clipboard
Copied
I just had a similar problem.
( function() {
var doc = app.activeDocument;
// the image page item
var r = doc.rectangles.item(0);
// the destination textframe to hold the inline
var tf = doc.textFrames.item(0);
// it should already be tagged.
// create a nested, blank tag
var xe = tf.associatedXMLElement.xmlElements.add("bla");
// copy the rect as inline
xe.placeIntoInlineCopy(r,true);
} )();
Find more inspiration, events, and resources on the new Adobe Community
Explore Now