Copy link to clipboard
Copied
Hi community,
I’m writing a script in JavaScript to process some images and save the result and some metadata in a folder and file chosen by the user.
Is there an API do that? i.e. to open a dialog similar to Photoshop’s save as dialog, so that the user can either pick a file already in the disk or enter the filename to create a new one.
I don’t want the dialog to save anything but just to return the full path to the file.
Best regards.
rraallvv77 schrieb:
… I don’t want the dialog to save anything but just to return the full path to the file.
Best regards.
I don't know what do you really want.
var aDoc = activeDocument;
var fName = aDoc.name;
alert(fName);
try {
var fPath = aDoc.path;
alert(fPath);
}
catch (e) { alert(fName + " was never saved before") }
e.g. gives you the file name and the path (if your document has a file path - was saved)
File.saveDlg();
Gives you a dialog for saving.
What do you really want to do?
Copy link to clipboard
Copied
From documentation:
Application.openDialog (): FileArray
Adobe Photoshop CC 2015.5 Object Library
Uses the Photoshop open dialog to select files.
Example:
alert(app.openDialog ());
Copy link to clipboard
Copied
rraallvv77 schrieb:
… I don’t want the dialog to save anything but just to return the full path to the file.
Best regards.
I don't know what do you really want.
var aDoc = activeDocument;
var fName = aDoc.name;
alert(fName);
try {
var fPath = aDoc.path;
alert(fPath);
}
catch (e) { alert(fName + " was never saved before") }
e.g. gives you the file name and the path (if your document has a file path - was saved)
File.saveDlg();
Gives you a dialog for saving.
What do you really want to do?
Copy link to clipboard
Copied
pixxxel schubser , I think saveDlg is the one I wanted thanks.
Jarda Bereza​, I already tried openDialog and searched in the photoshop-cc-javascript-ref-2015.pdf document but couldn't find anything similar to saveDlg, maybe the documentation is incomplete or I downloaded the wrong file, thanks.
Copy link to clipboard
Copied
You're welcome.
Furthermore File.saveDialog() method also exists.