I am trying to make a script for photoshop in js, and I want to add an image to a new layer. The proble is that I simply cant find the jpg (teszt_fekvő.jpg), evendough it is in the same folder. Here is the code:
var newDoucument=app.documents.add(1080, 1080, 300, "New Document", NewDocumentMode.RGB);
var layers = newDoucument.artLayers;
var newLayer = layers.add();
newLayer.name = "New Layer";
var imagePath= new File("~/teszt_fekvő.jpg");
imagePath=File.openDialog("please select files", getFiles, true);
if(imagePath.exists)
{
placeFile(imagePath);
}
else
{
alert("File not found");
}
I have tried absolute filepath, and I am 100% that the name of the file is correct.