Hi All,
Request:
For my script I want to copy all graphics from source document and paste in target document.
But for one particular art, the script is quit. That art name not comes in "Link" also (refer screenshot).
I dont know what format it is like tiff, eps etc.....
Please find the screenshot:
Trying Script(work fine all arts exept above mentioned art):
var mySourceDocument = app.documents[0]
var myDocName = mySourceDocument.name
myDocName = myDocName+"";
var ImageSizes = new Array;
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;
var docSource = app.documents.item(myDocName); // input the proper name
var docDestination = app.documents.item("testing.indd") // input the proper name
var myGraphics = mySourceDocument.allGraphics
for (i = 0; i < myGraphics.length; i++) {
var myGraphicsName = myGraphics[i].itemLink.name;
myGeometricBounds = myGraphics[i].parent.geometricBounds
var myWidth = myGeometricBounds[3] - myGeometricBounds[1]
var myHeight = myGeometricBounds[2] - myGeometricBounds[0]
if (i == 0) {
app.activeWindow = docSource.windows.item(0);
app.select(myGraphics[i].parent);
app.copy();
app.activeWindow = docDestination.windows.item(0);
app.paste();
}
if (i != 0) {
app.activeWindow = docSource.windows.item(0);
app.select(myGraphics[i].parent);
app.copy();
app.activeWindow = docDestination.windows.item(0);
app.paste();
}
}
Please find the error screenshot while running the script:
Could anyone give solution for my problem.
Thanks
BEGINNER_X