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

Export as... add prefix function to auto use PSD filename in output files

Enthusiast ,
Mar 31, 2023 Mar 31, 2023

Copy link to clipboard

Copied

Would be great to have the Export as... function the ability to take the filename and add into the export files filename, and /or ability to add custom prefix!! Already a Suffix field exists. PLEASE!!!!!!!!!!!!!

Idea No status

Views

1.5K

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
20 Comments
Enthusiast ,
Mar 31, 2023 Mar 31, 2023

Copy link to clipboard

Copied

Would be great to have the Export as... function the ability to take the filename and add into the export files filename, and /or ability to add custom prefix!! Already a Suffix field exists. PLEASE!!!!!!!!!!!!!

 

 

(Duplicate threads merged)

 

 

Votes

Translate

Translate

Report

Report
Community Expert ,
Mar 31, 2023 Mar 31, 2023

Copy link to clipboard

Copied

@Todd_Morgan 

 

Are you a Photoshop Developer or a user with feature request?

 

Jane

Votes

Translate

Translate

Report

Report
LEGEND ,
Mar 31, 2023 Mar 31, 2023

Copy link to clipboard

Copied

You may want to look at Image Processor Pro or Batch Rename in Bridge, those may be able to accomplish what you need.

https://sourceforge.net/projects/ps-scripts/files/Image%20Processor%20Pro/v3_2%20betas/

https://helpx.adobe.com/bridge/using/automate-tasks-adobe-bridge.html

 

Votes

Translate

Translate

Report

Report
Enthusiast ,
Mar 31, 2023 Mar 31, 2023

Copy link to clipboard

Copied

User...

Votes

Translate

Translate

Report

Report
Enthusiast ,
Mar 31, 2023 Mar 31, 2023

Copy link to clipboard

Copied

Nope... would be nice if Adobe just updated the software - this ask has been in the wind for years now.

Votes

Translate

Translate

Report

Report
Community Expert ,
Mar 31, 2023 Mar 31, 2023

Copy link to clipboard

Copied

"take the filename and add into the export files filename, and /or ability to add custom prefix"

 

Can you give us a little more clarity on your requst? What do you want that is different than the suggestions that Lumigraphics suggested? 

Michelle

Votes

Translate

Translate

Report

Report
Enthusiast ,
Mar 31, 2023 Mar 31, 2023

Copy link to clipboard

Copied

First off - Adobe Bridge is a PITA.

Next... if you used the Export as... function you would know what I am talking about. I work with files with several many artboards. And outputting them all through Artboards to Files works but for some reason takes forever. Using the export as... is fast. And much preferred - but it won't save with the PSD filename or allow to create a Prefix - suffic only.

Votes

Translate

Translate

Report

Report
LEGEND ,
Mar 31, 2023 Mar 31, 2023

Copy link to clipboard

Copied

Ok its been a request for years, but do you need to do this now? Because the evidence would suggest that it might not be a feature that is coming along anytime soon. So alternate ways to get where you need to be might be helpful.

Votes

Translate

Translate

Report

Report
LEGEND ,
Mar 31, 2023 Mar 31, 2023

Copy link to clipboard

Copied

Adobe devs have posted numerous times that Export is not finished. So who knows?

But for TODAY... is this a need or just a theoretical? Because we can help you find a way to do what you need, but we can't add a feature to the program. I'm offering some other ways to possibly do what you want. If that's not what you are asking for then I'll exit this thread.

Votes

Translate

Translate

Report

Report
Community Expert ,
Mar 31, 2023 Mar 31, 2023

Copy link to clipboard

Copied

Todd,

I don't know what you mean "Adobe Bridge is a PITA." And from your tone, frankly, I don't care to.

 

As Lumigraphics said above, we are here to help you. We can't change the function of the software, but we may have the knowledge to help you get around your roadblocks. If you need help, we are here for you. If all you want to do is complain, then I will follow Lumigraphics out of this thread.

Michelle

Votes

Translate

Translate

Report

Report
Community Expert ,
Mar 31, 2023 Mar 31, 2023

Copy link to clipboard

Copied

Hi, @Todd_Morgan FYI, Image Processor Pro works also inside Photoshop.

I know that Bridge 13 is far from perfect if you need multiple windows, but it is still possible to download and use Bridge 12.

Votes

Translate

Translate

Report

Report
Community Expert ,
Mar 31, 2023 Mar 31, 2023

Copy link to clipboard

Copied

User...

By @Todd_Morgan

 

Moved from Photoshop Developers > Ideas to Photoshop > Ideas

 

Jane

 

Votes

Translate

Translate

Report

Report
Community Expert ,
Apr 01, 2023 Apr 01, 2023

Copy link to clipboard

Copied

quote

I work with files with several many artboards. And outputting them all through Artboards to Files works but for some reason takes forever. Using the export as... is fast. And much preferred - but it won't save with the PSD filename or allow to create a Prefix - suffic only.


By @Todd_Morgan

 

I have added my vote for adding a prefix option.

 

Adding a custom prefix by typing into the field is different from using the filename. Perhaps if they added the ability to use a code such as "@@docname@@" or something, then it could use the document name without requiring a different field. Or perhaps a checkbox could automatically populate the field with the filename, and a radio button selection could set whether this is a prefix or suffix.

 

Sadly, Export As can't be scripted, so that is a dead end. There are alternative scripts to save artboards to files, however, I don't know if they are quicker or not. If they are quicker than the default artboards to files script, then they can be adapted to include prefix or suffix.

 

https://raw.githubusercontent.com/nvkzNemo/experimental-ps-scripts/master/artboardsToPSD.jsx

 

 
Another option is that a Photoshop script could batch rename the files that are output from Export As, changing the suffix to a prefix... But you would still need to enter the PSD name manually as a suffix when exporting, then run the script to rename the files.
 
EDIT:
 
The following script will copy the active document name (without extension) to the clipboard, ready to paste into the Export As Suffix field.
 
// Copy Document Name to Clipboard.jsx
#target photoshop 
var d = new ActionDescriptor();  
d.putString(stringIDToTypeID("textData"), activeDocument.name.replace(/\.[^\.]+$/, ''));  
executeAction(stringIDToTypeID("textToClipboard"), d, DialogModes.NO);

Votes

Translate

Translate

Report

Report
Community Expert ,
Apr 01, 2023 Apr 01, 2023

Copy link to clipboard

Copied


@Todd_Morgan wrote:

First off - Adobe Bridge is a PITA.


 

I can only presume that you don't like using the Adobe Bridge Batch Rename tool... So here is a Photoshop script to batch rename a folder of files meeting the following condition of a unique separator, in this case, an underscore character. This is easily adapted to a hyphen or another unique character.

 

Filename-1_Suffix.png

To:

Suffix_Filename-1.png
 
The script will additionally preserve the original filename in the file metadata for easy recovery of the original filename.

 

RENAME.png

 

/*

Rename Files in Folder Swapping Suffix to Prefix.jsx
https://community.adobe.com/t5/photoshop-ecosystem-ideas/export-as-add-prefix-function-to-auto-use-psd-filename-in-output-files/idi-p/13694701
v1.0, 2nd April 2023, Stephen Marsh

Notes: 
* Change the RegEx capture group underscore (_) to a hyphen (-) or another unique separator as required
* The original filename will be set in the preserved filename metadata to facilitate restoration of the original filename via Adobe Bridge, ExifTool etc.
* To do: Add an option to restore the preserved filename via the script

Batch renames files from:

Filename-1_Suffix.png
Filename-2_Suffix.png
Filename-3_Suffix.png

To:

Suffix_Filename-1.png
Suffix_Filename-2.png
Suffix_Filename-3.png

*/

#target photoshop

var theInputFolder = Folder.selectDialog("Please select the folder to swap the filename suffix to prefix:");
var theInputFiles = theInputFolder.getFiles(/\.(gif|png|jpe?g|tif?f|psd|psb)$/i);
for (var i = 0; i < theInputFiles.length; i++) {
    setPreservedFilenameMeta(theInputFiles[i], theInputFiles[i].displayName);
    var theRegEx = theInputFiles[i].name.replace(/(^.+)(_)(.+)(\.[^\.]+$)/, '$3$2$1$4');
    theInputFiles[i].rename(theRegEx);
}
app.beep();


function setPreservedFilenameMeta(theFile, theName) {
    if (!ExternalObject.AdobeXMPScript) ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');
    var xmpFile = new XMPFile(File(theFile).fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_UPDATE);
    var xmp = xmpFile.getXMP();
    xmp.setProperty('http://ns.adobe.com/xap/1.0/mm/', 'PreservedFileName', theName), xmp.rawData = xmp.serialize();
    if (xmpFile.canPutXMP(xmp)) {
        xmpFile.putXMP(xmp);
    }
    xmpFile.closeFile(XMPConst.CLOSE_UPDATE_SAFELY);
}

 

  1. Copy the code text to the clipboard
  2. Open a new blank file in a plain-text editor (not in a word processor)
  3. Paste the code in
  4. Save as a plain text format file – .txt
  5. Rename the saved file extension from .txt to .jsx
  6. Install or browse to the .jsx file to run (see below)

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

Votes

Translate

Translate

Report

Report
Community Expert ,
Apr 06, 2023 Apr 06, 2023

Copy link to clipboard

Copied

Due to underwhelming demand, I have updated the script to a 1.1 version to include the ability to restore the preserved filename metadata, just in case the batch renaming doesn't go to plan. Simply hold down the ALT/OPT key when running the script.

 

/*

Rename Files in Folder Swapping Suffix to Prefix.jsx
https://community.adobe.com/t5/photoshop-ecosystem-ideas/export-as-add-prefix-function-to-auto-use-psd-filename-in-output-files/idi-p/13694701
v1.1, 7th April 2023, Stephen Marsh

Notes: 
* Change the RegEx capture group underscore (_) to a hyphen (-) or another unique separator as required
* The original filename will be set in the preserved filename metadata to facilitate the restoration of the original filename via Adobe Bridge, ExifTool etc.

Changelog:
* v1.0: 2nd April 2023 - initial release
* v1.1: 7th April 2023 - Added an option to restore the preserved filename by holding down the ALT/OPT key when running the script

Batch renames files from:

Filename-1_Suffix.png
Filename-2_Suffix.png
Filename-3_Suffix.png

To:

Suffix_Filename-1.png
Suffix_Filename-2.png
Suffix_Filename-3.png

*/

#target photoshop

try {
    
    // Hold down ALT/OPT to restore the preserved filename
    if (ScriptUI.environment.keyboardState.altKey) {

        if (confirm("Do you really want to restore the original filenames?")) {

            var theInputFolder = Folder.selectDialog("Please select the folder to restore the original filenames:");
            // Add or remove supported file types as required
            var theInputFiles = theInputFolder.getFiles(/\.(gif|png|jpe?g|tif?f|psd|psb)$/i);
            for (var i = 0; i < theInputFiles.length; i++) {
                try {
                    // Get the preserved filename metadata
                    var xmpFile = new XMPFile(theInputFiles[i].fsName, XMPConst.FILE_UNKNOWN, XMPConst.OPEN_FOR_READ);
                    var xmpMeta = xmpFile.getXMP();
                    var preserved = xmpMeta.getProperty(XMPConst.NS_XMP_MM, "PreservedFileName");
                    // Rename the files
                    if (preserved != undefined) {
                        theInputFiles[i].rename(preserved);
                    } else {
                        alert("One or more files weren't renamed due to missing preserved filename metadata!");
                    }
                
                } catch (error) {
                    alert(error + ', Line: ' + error.line);
                }
            }
            app.beep();
        }

    // Rename using the suffix as the prefix
    } else {

        if (confirm("Do you really want to swap the filename suffix to a prefix?")) {

            var theInputFolder = Folder.selectDialog("Please select the folder to swap the filename suffix to a prefix:");
            // Add or remove supported file types as required
            var theInputFiles = theInputFolder.getFiles(/\.(gif|png|jpe?g|tif?f|psd|psb)$/i);
            for (var i = 0; i < theInputFiles.length; i++) {
                // Set the original filename to the preserved filename metadata
                setPreservedFilenameMeta(theInputFiles[i], theInputFiles[i].displayName);
                // Swap the suffix for the prefix
                var theRegEx = theInputFiles[i].name.replace(/(^.+)(_)(.+)(\.[^\.]+$)/, '$3$2$1$4');
                // Rename the files using the suffix as the prefix
                theInputFiles[i].rename(theRegEx);
            }
            app.beep();
        }
    }

} catch (error) {
    alert(error + ', Line: ' + error.line);
}


function setPreservedFilenameMeta(theFile, theName) {
    // Get the preserved filename metadata
    if (!ExternalObject.AdobeXMPScript) ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');
    var xmpFile = new XMPFile(File(theFile).fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_UPDATE);
    var xmp = xmpFile.getXMP();
    xmp.setProperty('http://ns.adobe.com/xap/1.0/mm/', 'PreservedFileName', theName), xmp.rawData = xmp.serialize();
    if (xmpFile.canPutXMP(xmp)) {
        xmpFile.putXMP(xmp);
    }
    xmpFile.closeFile(XMPConst.CLOSE_UPDATE_SAFELY);
}

 

Votes

Translate

Translate

Report

Report
Community Expert ,
Apr 06, 2023 Apr 06, 2023

Copy link to clipboard

Copied

For sake of completeness, for those that do wish to do this via Adobe Bridge's Batch Rename Tool, here are some visual examples:

 

Method 1: Delete the suffix and manually add the prefix:

 

batch-rename-0001.png

 

or

 

Method 2: Swap the suffix for the prefix

 

Find:

(^.+)(_)(.+)(\.[^\.]+$)

Replace:

$3$2$1$4

 

batch-rename-0002.png

 

 

Restore the preserved filename:

 

batch-rename-0003.png

Votes

Translate

Translate

Report

Report
Enthusiast ,
Apr 10, 2023 Apr 10, 2023

Copy link to clipboard

Copied

I already have several ways to do stuff outside of Photoshop - hence the ask to have it native in the software. @mglush when it comes to "complaining" about how bad Bridge is - that's a whole other pot to get into, and well noted by users.

Votes

Translate

Translate

Report

Report
Explorer ,
Nov 11, 2023 Nov 11, 2023

Copy link to clipboard

Copied

Just my two cents that I'd love this, too. I have to create artwork daily across mutlitple social networks. I label each file according to the part number. I want all the social media files to have the part number as the prefix so when I go to update all the social media accounts, they're all in one spot in alphabetical order. I'd prefer they are all named with a prefix: "Part0001Insta" "Part0001Facebook". The way it works now as a Suffix, it is alphabetized first by the artboard names "InstaPart0001" "FacebookPart0001". The suggestions that other people are making like using Bridge, or to somehow rename after the fact defeats the purpose of this feature request to begin with. I have a very specific workflow and having this feature would be a HUGE time saver. As the OP stated, it already has SUFFIX as an option. Doesn't seem difficult to make PREFIX an option as well. When you're creating literally thousands of files a month, any time saving is a plus.

Votes

Translate

Translate

Report

Report
Enthusiast ,
Nov 11, 2023 Nov 11, 2023

Copy link to clipboard

Copied

@Think Seed Thank you and exactly... glad there are other likeminded designers out there [abuse removed].

Votes

Translate

Translate

Report

Report
Community Expert ,
Nov 11, 2023 Nov 11, 2023

Copy link to clipboard

Copied

LATEST

Nobody has denied the usefulness of the feature request.

 

We are all end-users here, not Adobe staff.

 

All we can do is make pragmatic suggestions to work within the framework provided by Adobe for now, until further options are possibly added.

Votes

Translate

Translate

Report

Report