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

Remember Export Location

Community Beginner ,
Mar 04, 2022 Mar 04, 2022

Copy link to clipboard

Copied

It would be wildly useful if when doing an export (to .jpg, etc, not the quick export to PNG) that it would remember where you last save an export from that project. If it hasn't been exported previously, for it to default to where the .psd file (or source file) is located.

 

This should be saved within the .psd file, since it requires you to save after doing the export. The quick export to PNG goes to the same location as the source file and that is great.

 

An alternate option would be have a button on the export screen to go to source location.

Idea No status
TOPICS
Actions and scripting , Windows

Views

771

Translate

Translate

Report

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
19 Comments
Explorer ,
Mar 04, 2022 Mar 04, 2022

Copy link to clipboard

Copied

I'll second that - I regularly use 'Export layers to Files', and every time have to reset the destination folder to the source folder, or my designated folder. All other Save dialogs stay in the same location when recalled.

Votes

Translate

Translate

Report

Report
Community Expert ,
Mar 04, 2022 Mar 04, 2022

Copy link to clipboard

Copied

Like this?

 

prefs.png

Votes

Translate

Translate

Report

Report
Explorer ,
Mar 05, 2022 Mar 05, 2022

Copy link to clipboard

Copied

Oh god, sorry, I'd never noticed that! Thank you! 🙂

Votes

Translate

Translate

Report

Report
Community Beginner ,
Mar 05, 2022 Mar 05, 2022

Copy link to clipboard

Copied

Thanks for pointing out that setting in Preferences, I guess I should have looked there, but that solves one issue, but not the second. 99% of the time I do want it going to the location where the document is at, but if I export to a different location, I would prefer it save that with the document and do that. The last location setting does it to the last place a document was saved, not the last place where the current document was saved. In a perfect world, there would be an order to which it does it. First to where the current document was last saved, for the format being exported, if it hasn't been exported previously, it defaults to the location of the current document and lastly if you are exporting a document that you haven't saved, it will default to the last place any document was stored.

But, this setting does improve the situation quite a bit. Thanks again.

Votes

Translate

Translate

Report

Report
Community Beginner ,
Mar 05, 2022 Mar 05, 2022

Copy link to clipboard

Copied

Interestingly enough, changing that setting messed up the Quick Export to PNG. That used to always go to the document location, but now it doesn't.

Votes

Translate

Translate

Report

Report
Explorer ,
Mar 06, 2022 Mar 06, 2022

Copy link to clipboard

Copied

That setting in Preferences has no effect for me. Every time I select 'Export Layers to Files', the dialog defaults to my Windows/User folder, even if I specified a folder with the previous export action. I have it exactly as shown in the example?

Votes

Translate

Translate

Report

Report
Community Expert ,
Mar 06, 2022 Mar 06, 2022

Copy link to clipboard

Copied

quote

That setting in Preferences has no effect for me. Every time I select 'Export Layers to Files', the dialog defaults to my Windows/User folder, even if I specified a folder with the previous export action. I have it exactly as shown in the example?

 

@Phil Wolstenholme23 

 

That preference setting is only for Quick Export and Export As, which is not the same thing as Export Layers to Files, which is a script. The script would require editing.

Votes

Translate

Translate

Report

Report
Community Expert ,
Mar 07, 2022 Mar 07, 2022

Copy link to clipboard

Copied

I have edited the script. It is not exactly the last save location, it is the last location explicitly set...

 

To set the save path to be remembered, hold down the SHIFT key when running the script. Run the script a second time without the shift key depressed to use the saved location. If the save location is not explicitly set, the default location will be the active document path (as per the standard script). Unsaved source files will default to a blank save location (as per the standard script).

 

https://github.com/MarshySwamp/Export-Layers-To-Files-Last-Location/blob/main/Export%20Layers%20To%2...

 

Quickstart:

 

  1. Copy the code text to the clipboard
  2. Open a new blank file in a plain-text editor (not word-processor)
  3. Paste the code in
  4. Save the text file as Export Layers To Files - Last Location.txt
  5. Rename the file extension from .txt to .jsx

 

To install the script:

https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html#Photoshop

 

The installed script will appear in the File > Export menu above the default script

Votes

Translate

Translate

Report

Report
Explorer ,
Mar 07, 2022 Mar 07, 2022

Copy link to clipboard

Copied

Many thanks for doing this. However, I've just set it all up, but it only half-works - sorry if I'm misunderstanding. But I've installed the script, and it does appear in the menu above the Export Layers to Files script. Running the new script with the shift key held down does indeed bring up a save dialog to specify a folder, and that duly done, the script alert pops up instructing me to run the script again without the shift key. But when I do that, the regular Export Layers to Files dialog pops up asking me to choose a destination folder - which is my default User folder again. It won't let me export without me choosing a folder here! Shouldn't this step just be ignored by the script and the export be run?

 

I'll be away for the next two days, so no panic on a reply

Votes

Translate

Translate

Report

Report
Community Expert ,
Mar 07, 2022 Mar 07, 2022

Copy link to clipboard

Copied

The second time that you run the script, are you running:

 

Export Layers To Files - Last Location.jsx

 

Which is the correct script, or are you running the incorrect script (Export Layers To Files.jsx)?

 

EDIT: I have tested on both Mac and Win v2021 and v2022 and it works as expected...

 

In this screenshot, the original file is on the desktop. When I held down shift, I selected a folder titled output on the desktop. When the script was run without shift, it defaulted to the output folder and not the desktop. Are you on Mac or Windows?

 

path.png

Votes

Translate

Translate

Report

Report
Explorer ,
Mar 08, 2022 Mar 08, 2022

Copy link to clipboard

Copied

I'm on Windows. Maybe I should try it with a different folder setup than the source. Sadly I have to leave now and won't have internet until tomorrow evening, so I'll check back then.

 

Thanks for the help so far!

 

Phil.

Votes

Translate

Translate

Report

Report
Community Expert ,
Mar 08, 2022 Mar 08, 2022

Copy link to clipboard

Copied

You can always double-check that the save path has been successfully written to the preference file ".Export Layers to Files Last Location.log" which can be found in the user's home folder. For Mac OS, this file is invisible as it has a leading dot character. The script can be edited to remove the leading dot character.

 

This is the path that the script will use if the file has been previously saved. If the save location is not explicitly set via the shift key run, the default location will be the active document path (as per the standard script). Unsaved source files will default to a blank save location (as per the standard script).

 

The path has to be explicitly set via the shift run step to log the save path, I don't know how to make this automatically happen without this manual preliminary step.

Votes

Translate

Translate

Report

Report
Explorer ,
Mar 11, 2022 Mar 11, 2022

Copy link to clipboard

Copied

Sorry for the massive delay in replying - been a bit busy on other things. I just checked the log file in the User folder and the folder location I required was saved correctly in there. So I'm a bit baffled by the regular save dialog then appearing when I run the script the second time. I just did the process again on a different set of images - the log file just updated correctly to my new location, I then ran the script again without holding the Shift key down, and up popped the regular Export Layers to Files dialog - and if I hit Run it asked me to specify a folder location. Hitting 'Browse' then just takes me to the User folder! So back to square one.

Votes

Translate

Translate

Report

Report
Community Expert ,
Mar 11, 2022 Mar 11, 2022

Copy link to clipboard

Copied

I can't explain why you are getting a different result than me...

 

Try this, remove all of the code before:

 

#target photoshop

 

And report back...

 

P.S. The script can be modified and split into two separate scripts, the key modifier is just a nice touch but not a requirement.

Votes

Translate

Translate

Report

Report
Explorer ,
Mar 11, 2022 Mar 11, 2022

Copy link to clipboard

Copied

Sorry, starting from where? Removing everything before # target photoshop causes the script not to load. I'm deep into some work at the moment so apologies if this is rather slow.

Votes

Translate

Translate

Report

Report
Community Expert ,
Mar 11, 2022 Mar 11, 2022

Copy link to clipboard

Copied

I'll look into it, I was shooting from the hip!

 

EDIT:

 

@Phil Wolstenholme23 – It works as I expected, however, I didn't clearly state the objective. By removing all of the code from before the target statement, the script will no longer appear under the File > Export menu, it will instead appear in the standard File > Scripts menu.

 

I changed the name of the Export menu item and created a new random UUID to avoid any conflict with the default script, which works fine for me in 2021 and 2022 versions on both Mac and Win, so I can't explain why the script works on the first shift run, but the original script is called on the second run without shift.

 

Let's see how this goes with that code chunk removed...

 

Another thing to try would be to backup and remove the standard Adobe script.

Votes

Translate

Translate

Report

Report
Community Expert ,
Mar 11, 2022 Mar 11, 2022

Copy link to clipboard

Copied

@Phil Wolstenholme23 

I have split the script into 2 separate scripts, so rather than holding down shift, the script 1 of 2 will be run to set the path, while script 2 of 2 will bring up the layers to files window with the path pre-set. These scripts will appear in the standard File > Scripts menu.

 

https://github.com/MarshySwamp/Export-Layers-To-Files-Last-Location-2-Part

Votes

Translate

Translate

Report

Report
Explorer ,
Mar 12, 2022 Mar 12, 2022

Copy link to clipboard

Copied

Stephen

 

Many thanks for your continued effots on this - it's much appreciated. However, sadly, I'm still getting the same result. Running script 1 works perfectly, and a windows file dialog promopts me to set the save path, and the confirmation widown then tells me to run Script 2. On running that though, I simply get the regular save dialog but with no path saved in the field - still defaulting to the User folder 😞

 

I've attached screenshots of the two sequences, but I have no idea why the second one isn't picking up the saved path, as that is definitely updating in the log file if I choose a new folder to save to.

 

Cheers

Phil.ScriptError1.jpgScriptError2.jpg

Votes

Translate

Translate

Report

Report
Community Expert ,
Mar 12, 2022 Mar 12, 2022

Copy link to clipboard

Copied

LATEST

I have made some mostly cosmetic changes to both scripts, when running the 2 of 2 script the title of the new dialog should show "Export Layers To Files - Last Location" instead of the standard "Export Layers To Files" to help identity which script is in use.

 

I can't work out why you are not seeing the same results as I am. You can download the updated code and try again, however, I am doubting that you will have a different result. Remember that unsaved files will be blank for the path, only saved files will pickup the path from the log file. The joy of coding!

Votes

Translate

Translate

Report

Report