Copy link to clipboard
Copied
I have a use case involving Adobe Photoshop on macOS where I need the Open/Save dialog panel to automatically open a specific directory—ideally one where my test files are already located.
Is there a way to achieve this programmatically on macOS? I'm open to solutions using:
The goal is to streamline the workflow by pre-setting the folder path when the dialog appears.
Has anyone implemented something similar or can point me in the right direction?
Thanks in advance!
— Varadharajan Venkat
An example here for saving as JPEG, with AM code and DialogModes.ALL
Copy link to clipboard
Copied
I don’t fully understand the scenario.
Is there any relation to the open file you want to save and the intended target location (» where my test files are already located«) or is that a different, but fixed location?
Copy link to clipboard
Copied
This should open the Save As-dialog with the target position being a Folder named »untitled folder« on the Desktop (if it exists).
// 2025, use it at your own risk;
if (app.documents.length > 0) {
try {
var thePath = "~/Desktop/untitled folder";
var theName = activeDocument.name;
var desc6 = new ActionDescriptor();
var desc7 = new ActionDescriptor();
desc6.putObject( stringIDToTypeID( "as" ), stringIDToTypeID( "photoshop35Format" ), desc7 );
desc6.putPath( stringIDToTypeID( "in" ), new File( thePath+"/"+theName ) );
desc6.putBoolean( stringIDToTypeID( "lowerCase" ), true );
desc6.putEnumerated( stringIDToTypeID( "saveStage" ), stringIDToTypeID( "saveStageType" ), stringIDToTypeID( "saveSucceeded" ) );
executeAction( stringIDToTypeID( "save" ), desc6, DialogModes.ALL );
} catch (e) {}
};
Copy link to clipboard
Copied
An example here for saving as JPEG, with AM code and DialogModes.ALL
Find more inspiration, events, and resources on the new Adobe Community
Explore Now