Question
Cannot save active layer as jpg using ExtendScript
This my code:
options = new JPEGSaveOptions()
options.quality = 1
options.embedColorProfile = true
imagepath = Folder.temp.fsName + "\\" + "image_to_upload"
jpg = new File(imagepath)
app.activeDocument.saveAs(jpg, options)
It works fine if I open an image in Photoshop and then run the code, however, if I do so editing on the image, then it does not work. Only a save-the-document-as window opens up but the jpg is not saved. Any help?
This a screenshot of when I run the code but it does not work:

