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

Cancel Suffix Number Addition When Reopen Raw filess (CR2)

Enthusiast ,
Apr 25, 2022 Apr 25, 2022

Hello,

Since one of the latest updates (I don’t remember which one), everytime I reopen a Raw file (CR2 in my case), Photoshop auto adds a suffix number after the file name.

 

Can I cancel this behaviour?

 

Thank you

Shlomit

TOPICS
macOS
1.1K
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

correct answers 1 Correct answer

Community Expert , Apr 25, 2022 Apr 25, 2022

I'll post an updated version... If you are not opening the raw files as smart objects, I'll need to modify the previously linked script...

 

Edit: @Shlomit Heymann – here is the updated version for use with raw files from ACR which are not smart objects. Please let me know if there are any issues and or if it works OK for you:

 

/*
Remove Ending Hyphen Digit from ACR Files.jsx
Stephen Marsh, 26th April 2022, v1.0
https://community.adobe.com/t5/photoshop-ecosystem-discussions/cancel-suffix-number
...
Translate
Adobe
Community Expert ,
Apr 25, 2022 Apr 25, 2022

@Shlomit Heymann – Not that I am aware of.

 

I wrote a script for another user to automatically dupe/rename... but I can't find it in my archive.

 

I'll see if I can find it on the forum.

 

EDIT: Here it is –

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 ,
Apr 25, 2022 Apr 25, 2022

I'll post an updated version... If you are not opening the raw files as smart objects, I'll need to modify the previously linked script...

 

Edit: @Shlomit Heymann – here is the updated version for use with raw files from ACR which are not smart objects. Please let me know if there are any issues and or if it works OK for you:

 

/*
Remove Ending Hyphen Digit from ACR Files.jsx
Stephen Marsh, 26th April 2022, v1.0
https://community.adobe.com/t5/photoshop-ecosystem-discussions/cancel-suffix-number-addition-when-reopen-raw-filess-cr2/td-p/12904160
Based on:
https://community.adobe.com/t5/photoshop-ecosystem-discussions/stop-photoshop-adding-number-suffixes-to-documents/m-p/12767371
Note: Use the Scripts Events Manager - Open Document event to automatically run this script when opening files from Adobe Camera Raw
*/

#target photoshop

// CHECK FOR OPEN DOCS
if (documents.length) {

    // LOOP OVER OPEN FILES
    for (var i = 0; i < documents.length; i++) {
        activeDocument = documents[i];
        // PROCESS FILES WITHOUT A FILENAME EXTENSION
        if (/\.[^\.]+$/i.test(activeDocument.name)) {} else {
            if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');
            var xmp = new XMPMeta(activeDocument.xmpMetadata.rawData);
            var crsMeta = xmp.getProperty(XMPConst.NS_CAMERA_RAW, "Version");
            if (activeDocument.name.match(/-\d+$/) && activeDocument.activeLayer.isBackgroundLayer && activeDocument.layers.length === 1 && crsMeta !== undefined) {
                var origDoc = activeDocument;
                var docName = origDoc.name.replace(/-\d+$/, '');
                origDoc.duplicate(docName, false);
                origDoc.close(SaveOptions.DONOTSAVECHANGES);
                // END OF SCRIPT NOTIFICATION
                app.beep();
            }
        }
    }

    // ALERT IF NO DOCS OPEN
} else {
    alert('You must have a document open!');
}

 

The script is intended to be used via the Script Events Manager for the Open Document event:

https://prepression.blogspot.com/2021/10/photoshop-script-events-manager.html

 

Saving JavaScript Source Code:

  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 the text file as .txt
  5. Rename the 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

 

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 ,
Apr 27, 2022 Apr 27, 2022

@Shlomit Heymann - So, how did the script go?

 

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
Enthusiast ,
May 03, 2022 May 03, 2022

Hi Stephen, 

Thank you very much for your help.

I followed all instructions, but when reopen Bridge I got this error msg:

ShlomitHeymann_0-1651640632331.png

All the best,

Shlomit

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 ,
May 03, 2022 May 03, 2022
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
Enthusiast ,
May 04, 2022 May 04, 2022

Dear Stephen,

Thank you very much. Im sure I got it as it doesn't work.

This is what I did:

ShlomitHeymann_0-1651655341623.png

When I open the document I can hear a noise and than it looks like it's reopen and the extension disappears. When I press "Save" it doesn't offer the target folder (of the orginal fle) as it used to but offers to save to creative cloud. Also, when I open multiple files it treats ony the first one. Maybe I'm doing something wrong. 

 

Thank you for your help. 

Shlomit

 

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
Enthusiast ,
May 04, 2022 May 04, 2022

I'm unable to edit my reply.

First sentece should be "I'm not sure I got it. This is how it works:"

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 ,
May 04, 2022 May 04, 2022

Sorry, it (obviously) works for me... I don't know why you are not seeing the same thing.

 

The original file may be FILENAME.CR2, when it is opened again, it may be FILENAME-2 (without the .CR2 extension). The script beeps to inform you that it has successfully done something, in this case duplicating and closing the original document with the hyphen-digits at the end removed. When I save, it defaults to the original folder. I'm on a Mac and my preferences/file handling/save as to the original folder is active.

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
Enthusiast ,
May 04, 2022 May 04, 2022

Hi Stephen, 

Oh, no need to say sorry. You've been kind enough to try to help 🙂

I'm on mac too, I checked my prefs and my default file location was set to creative cloud. I changed it to my computer and it's ok now. 

 

I tried to reopen 3 files and got an error msg:

ShlomitHeymann_0-1651721002083.png

When I click ok all the 3 where open without the suffix and extention. 

 

In General, I still don't understand why Adobe made this suffix and why I can't choose weather to use it or not. 

 

I really appreciate your help.

 

Thank you

Shlomit

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 ,
May 04, 2022 May 04, 2022

Again, I'm not sure why you are getting that error, but it sounds like things are mostlly working as intended.

 

You can change the line near the bottom from –

 

app.beep();

 

 

 

To (adding //) –

 

// app.beep();

 

 

 

To remove the beep sound (or just delete it and the preceding comment)!

 

I can't recall why the hypen-digits are added, I think it is to stop duplicates of the same name.

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
Enthusiast ,
May 04, 2022 May 04, 2022
LATEST

Thank you! 🙂 I did it. 

good day

shlomit

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