Copy link to clipboard
Copied
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
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
...
Copy link to clipboard
Copied
@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 –
Copy link to clipboard
Copied
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:
https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html#Photoshop
Copy link to clipboard
Copied
@Shlomit Heymann - So, how did the script go?
Copy link to clipboard
Copied
Hi Stephen,
Thank you very much for your help.
I followed all instructions, but when reopen Bridge I got this error msg:
All the best,
Shlomit
Copy link to clipboard
Copied
#target photoshop
It's a Photoshop script:
https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html#Photoshop
https://prepression.blogspot.com/2021/10/photoshop-script-events-manager.html
Copy link to clipboard
Copied
Dear Stephen,
Thank you very much. Im sure I got it as it doesn't work.
This is what I did:
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
Copy link to clipboard
Copied
I'm unable to edit my reply.
First sentece should be "I'm not sure I got it. This is how it works:"
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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:
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Thank you! 🙂 I did it.
good day
shlomit
Find more inspiration, events, and resources on the new Adobe Community
Explore Now