Script to resize a file PNG
Good evening everyone:
My script, opens a PNG file and reads its contents. Then the script opens another file (Mockup_001.ai) and pastes the PNG file. The problem now is that I need this PNG image to be in a certain position and with a certain size. How to proceed? Follow the script...
Thanks for any suggestion.
var filePng = "C:\\Temp\\PNG.png";
var fileMockup = "C:\\Temp\\Mockup_001.ai";
var docPng=app.open(File(filePng));
var newItem;
var copiaPNG = app.activeDocument.selection;
mockup = app.open(File(fileMockup));
if (copiaPNG.length > 0) {
for(var i=0; i<copiaPNG.length; i++){
copiaPNG[i].selected = false;
newItem = copiaPNG[i].duplicate(mockup, ElementPlacement.PLACEATBEGINNING);
}
}
