Skip to main content
WIDSnonamer
Inspiring
November 7, 2022
Answered

Error 1200 on app.paste()

  • November 7, 2022
  • 1 reply
  • 1342 views

Good day, 
I recently ran into a problem with Illustrator on one of my machines. I am pasting files into one document and on one of three workstations  Illustrator throws the Error 1200 ( See attached screenshot) while pasting the second file. I already tried some workaround like placing a delay before pasting, closing the SourceDocument after the app.paste() or doing app.redraw(), none of them worked. The only thing that prevents the errror is an allert() before the paste command - which is halting the automatic process. I can't find troubleshootings on this particular issue in google, maybe one of you ran into this or a related issue before and knows a solution. Thanks in advance! 

 

This topic has been closed for replies.
Correct answer WIDSnonamer

does the error happen when destDoc is a new blank document?


Destdoc ist a new blank document, but the Error occurs only in the second time Paste is executed - so there ist already content in the document. 

 

But i already got a workaround - before pasting i add a temp pathitem and remove it aber eben the Paste doesn't throw the Error.

1 reply

Mylenium
Legend
November 7, 2022

Perhaps there's something running on the machine that messes with the clipboard completely unrelated to AI... I'd check that.

 

Mylenium

WIDSnonamer
Inspiring
November 7, 2022

I already did, and also refreshed drivers on the machine. I doubt that it is a problem with the clipboard hence it working with the alert() before pasting.

WIDSnonamer
Inspiring
November 7, 2022

Hi,

Could you please share your code, that will help us to debug and see?


Cant post the whole Code, but here is the function i am using. It is working on two different machines. On the third machine it throws the error BUT only on the second file. The first file is pasted and positioned as it should. 

/**
 *  Copy all Items in file to destination document and position it with positionPasted();
 *  
 *  @9397041 File file - file to be copied
 *  @9397041 String pos - position on the file
 *  @9397041 String size - dimensions of the file
 *  @9397041 Document destDoc - destination document
 *  @Return 
 */
function placeLaserfiles(file, pos, size, destDoc) {
    var singleFile = app.open(file);

    var orientation = null;
    if (singleFile.width > singleFile.height) {
        orientation = "landscape";
    } else {
        orientation = "portrait";
    }

    for(var i = 0; i < singleFile.pageItems.length; i++) {
        singleFile.pageItems[i].selected = true;
    }

    app.copy();
    destDoc.activate();
    //alert("test");
    app.paste();

    positionPasted(pos, size, orientation, destDoc);
    singleFile.close(SaveOptions.DONOTSAVECHANGES);
    return;
}