Copy link to clipboard
Copied
Hi,
Is there a way we can cut paste an image rectangle into a text frame without using app.cut() & app.paste() ?
Thanks,
Copy link to clipboard
Copied
Hi
Is what you want do create Anchored Object without using cut() and paste()
try this code.
/**
* without using cut() and paste()
*
* env>
* a document has one textframe and graphicframe(rectangle)
*
*/
var doc = app.documents[0];
var org = doc.rectangles[0];// has an image
var tf = doc.textFrames[0];
var dup = tf.parentStory.insertionPoints[-1].rectangles.add();
for (var j in org.properties) {
try {
dup
thank you
mg
Copy link to clipboard
Copied
That is fine. But not working with documents created elsewhere. It throw the exception 'Can not find the folder --'. This is because it looks for the image path from where the image has been originaly placed. Is there any other alternatives?
Thanks.
Copy link to clipboard
Copied
Hi.
is your operation system "Windows"?
try this code
var doc = app.documents[0];
var org = doc.rectangles[0];// has an image
var tf = doc.textFrames[0]; // bigger than image
var dup = tf.parentStory.insertionPoints[-1].rectangles.add();
for (var j in org.properties) {
try {
dup