I am new to scripting in Illustrator.
I am trying to import PSD files into an AI layer.
So far this is my solution.
var TRGdoc = app.documents.add(DocumentColorSpace.RGB, "1920", "1080");
var onFile = File( '~/Desktop/jpeger/illDanceREFon_00642.psd' );
var REFon = app.open(onFile);
var LAYon = REFon.layers[0];
var LAYstuffon = LAYon.pageItems[0];
LAYstuffon.selected = true;
app.copy();
TRGdoc.activate();
var TRGlayer = TRGdoc.layers[0];
TRGlayer.selected = true;
app.paste();
It works most of the time but sometimes it hangs up on the paste. It feels sloppy.
Just wondering if a more elegant solution exists.
Thanks for looking!