I have an open document on PS. I need to create a new layer and import a JPG file into this new layer. This is the script I have:
//Creating a new variable that references a newly created layer and calling it "newLayerRef"
var newLayerRef = app.activeDocument.artLayers.add();
//Creating a variable to store the path of the JPG file that I want to open.
var img = new File("C:\\Users\\Master\\Desktop\\PS Requests\\1616-OtherBanner-text banner large size.jpg");
//Assigning the JPG file to the
newLayerRef.image = img;
At this point, I am expecting the JPG file to show up in the new layer of the document open in PS. But this does not happen. What am I doing wrong? How do I open a JPG into a new layer using PS JavaScript?
Assistance would be appreciated.
//Creating a new variable that references a newly created layer and calling it "newLayerRef"
var newLayerRef = app.activeDocument.artLayers.add();
//Creating a variable to store the path of the JPG file that I want to open.
var img = new File("C:\\Users\\Master\\Desktop\\PS Requests\\1616-OtherBanner-text banner large size.jpg");
//Assigning the JPG file to the
newLayerRef.image = img;
At this point, I am expecting the JPG file to show up in the new layer of the document open in PS. But this does not happen. What am I doing wrong? How do I open a JPG into a new layer using PS JavaScript?
Assistance would be appreciated.