आप अपनी छवि को खोज रहा है और एक परत
file = app.openDialog();//opens dialog,choose one image
if(file[0]){ //if you have chosen an image
app.load(file[0]); //load it into documents
backFile= app.activeDocument; //prepare your image layer as active document
backFile.resizeImage(width,height); //resize image into given size i.e 640x480
backFile.selection.selectAll();
backFile.selection.copy(); //copy image into clipboard
backFile.close(SaveOptions.DONOTSAVECHANGES); //close image without saving changes
doc.paste(); //paste selection into your document
doc.layers[0].name = "BackgroundImage"; //set your layer's name
}
में है कि जोड़ने के लिए फ़ोटोशॉप फ़ाइल संवाद खोल सकते हैं के साथ फ़ोटोशॉप एक कैलेंडर बनाने का एक अच्छा उदाहरण है जावास्क्रिप्ट एक्सटेंशन (.jsx)।
कृपया जांचें कि here