I have a for loop which moves all elements of an "Artwork" layer to a "working" layer so that I can edit the elemets without a chance of affecting the original layer:
for (var i=app.documents[0].layers['Artwork'].pageItems.length-1; i>=0; i--)
{
try
{
app.documents[0].layers['Artwork'].pageItems[r].duplicate(app.documents[0].layers['workin g'], ElementPlacement.PLACEATEND);
}
catch(e)
{
alert(e);
}
}
This seems to work fine for three or four documents, and then begins to return the following error:
Error: an Illustrator error occurred: 1346458189 ('MRAP')
Action on every document then returns this error, even ones on which it has previously worked. The only solution is to quit Illustrator and relaunch.
Am I missing something obvious?
Thanks in advance.