Answered
learning scripting with javascript create file
I'm learning scripting in photoshop and using the scripting guide from 2020. The new File javascript doesn't create the file, and the script fails. Could it be that this is no longer supported? Is there other way to create a file?
I will try to test on a windows machine o see if there is any difference.
I will try to test on a windows machine o see if there is any difference.
var originalRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
filePath = "/Users/$USERNAME/Desktop/myfile1.pdf"
var fileRef = new File(filePath);
var pdfOpenOptions = new PDFOpenOptions
pdfOpenOptions.antiAlias = true
pdfOpenOptions.mode = OpenDocumentMode.RGB
pdfOpenOptions.resolution = 72
pdfOpenOptions.page = 3
app.open( fileRef, pdfOpenOptions )
app.preferences.rulerUnits = originalRulerUnits
