Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to Programmatically Set Default Directory in macOS Photoshop Open/Save Dialog?

New Here ,
Sep 24, 2025 Sep 24, 2025

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:

  • AppleScript
  • Automator
  • Shell scripts
  • Photoshop scripting (ExtendScript or UXP)
  • Any other relevant macOS APIs or tools

 

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


TOPICS
Actions and scripting , macOS , SDK
331
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Sep 25, 2025 Sep 25, 2025

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? 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 09, 2025 Oct 09, 2025

We are creating adobe exams in photoshop, illustrator, indesign, after effects, premier pro, etc for that we have created few test files in which the candidate needs to work on it and save it. when the candidate opens a open/save panel, they are redirecting to the previous location where they opened or saved a file. accidentally they click save without verifying the location. if we are able to make the open or save panel to always open my predefined folder using any of the above given programming languages, it would be gret. Thanks.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 10, 2025 Oct 10, 2025

Please elaborate. 

Do you want to prevent the users from using a simple »Save« but raise the »Save As«-dialog instead? 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 10, 2025 Oct 10, 2025

For example if the user have previously used Decuments directory to open or save a file, then on next time when the user goes to file->open or File->save, it is redirecting to Documents directory by default, instead, i need to set my path.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 10, 2025 Oct 10, 2025

But only for specific files? 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 10, 2025 Oct 10, 2025

No until i reset back(meaning until the test is completed).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 11, 2025 Oct 11, 2025

I am not sure I understand your actual intended process. 

 

I suppose one could catch the Save-event via Script Events Manager and run a Script instead. 

But that would need to be set on every computer in question. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 12, 2025 Oct 12, 2025

We can set it on every computer using preferences if available or if we have the extended script and if we have a way to get notified when a open or save panel is triggered we could run the script and in the end we can restore the application preferences to its original state.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 13, 2025 Oct 13, 2025
LATEST

Unfortunately I have not been able to catch the »Save As«-command via Script Events Manger. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 25, 2025 Sep 25, 2025

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) {}
};

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 25, 2025 Sep 25, 2025

An example here for saving as JPEG, with AM code and DialogModes.ALL

 

 
EDIT: This one defaults the save dialog to the active document path, offering interactivity for selecting the file format and or using a different location if needed:
 
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines