How to load an image in active document? (Photoshop Scripting) -
i new photoshop scripting.
i want load image image (from hard disk) active document new layer positioning. how can done? can please share code?
thanks
you can open photoshop file dialog searching image , adding layer
file = app.opendialog();//opens dialog,choose 1 image if(file[0]){ //if have chosen image app.load(file[0]); //load documents backfile= app.activedocument; //prepare image layer active document backfile.resizeimage(width,height); //resize image given size i.e 640x480 backfile.selection.selectall(); backfile.selection.copy(); //copy image clipboard backfile.close(saveoptions.donotsavechanges); //close image without saving changes doc.paste(); //paste selection document doc.layers[0].name = "backgroundimage"; //set layer's name }
there example of making calendar photoshop javascript extension (.jsx).
please check here
Comments
Post a Comment