Copy link to clipboard
Copied
I utilize software that differentiates Targa files by the extension.
Files with .1 insteat of .TGA are front views, and files with .2 are side views, etc.
These are Targa 16bit files.
I need to be able to load .1 files in Photoshop, edit and save as an extension other than .TGA.
PLEASE HELP.
Copy link to clipboard
Copied
The files are actually 32bit Targa.
Copy link to clipboard
Copied
Working with non-standard file extensions will require you to jump through some hoops, particularly so in Windows.
You should be able to save valid TGA files from Photoshop by changing the extension from .tga to .1 etc.
The issue is opening such files in Photoshop for Windows.
I would suggest that you Batch Rename the images using Adobe Bridge:
Regular Expression Find:
(^.+)(\.)(\d+)
Replace With:
$1.$3.tga
Where "test.1" or "test.2" etc. would be renamed to "test.1.tga" or "test.2.tga" which now has a valid file extension for opening into Photoshop on Windows, while preserving the original number designation for the view.
After saving the files from Photoshop, you would need to remove the .tga to return to the non-standard naming.
Bridge makes it very difficult to Batch Rename without using a valid extension, I know that it can be done but it escapes me at this time. You could possibly use another bulk renaming utility to remove the .tga file extension. Last resort would be manually remove the .tga extension.
Another alternative would be a custom script.
I'm interested to see what others come up with!
Copy link to clipboard
Copied
@Gregory381864901nnt – Here are 2 Photoshop scripts.
Script 1 of 2:
/*
Script 1 of 2 - Rename TGA to Open in Photoshop.jsx
v1.0 - 22nd June 2024, Stephen Marsh
Renames a folder of custom extension files from "image.1", "image.2" etc. to "image.1.tga" "image.2.tga" etc.
https://community.adobe.com/t5/photoshop-ecosystem-discussions/please-help-need-to-open-and-save-targa-files-with-different-extension-than-tga/td-p/14695748
*/
#target photoshop
(function () {
var theInput = Folder.selectDialog("Please select the folder:"),
theFiles = theInput.getFiles(/\.\d+$/i),
theFile,
theName;
for (var i = 0; i < theFiles.length; i++) {
theFile = theFiles[i];
theName = theFile.name.replace(/(^.+)(\.)(\d+)/, '$1.$3.tga');
theFile.rename(theName);
}
/*
// Open the files
var theFiles = theInput.getFiles(/\.tga$/i);
for (var i = 0; i < theFiles.length; i++) {
var openFiles = app.open(File(theFiles[i]));
}
*/
})();
Script 2 of 2:
/*
Script 2 of 2 - Rename TGA to Open in Photoshop.jsx
v1.0 - 22nd June 2024, Stephen Marsh
Renames a folder of files from "image.1.tga" "image.2.tga" etc. to "image.1" "image.2" removing the standard .tga extension
https://community.adobe.com/t5/photoshop-ecosystem-discussions/please-help-need-to-open-and-save-targa-files-with-different-extension-than-tga/td-p/14695748
*/
#target photoshop
(function () {
var theInput = Folder.selectDialog("Please select the folder:"),
theFiles = theInput.getFiles(/\.tga$/i),
theFile,
theName;
for (var i = 0; i < theFiles.length; i++) {
theFile = theFiles[i];
theName = theFile.name.replace(/(^.+)(\.[^\.]+$)/, '$1');
theFile.rename(theName);
}
})();
https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html
Copy link to clipboard
Copied
Thanks for the information but that will not work due to the software that loads the files is looking to assign each to a side. Front = .1 Side = .2 etc. The prefix is UPC so this is a systematic funtion of the software we use to create Planograms (if your familiar with that term). Another software product had a configuration setting ...see attached
Copy link to clipboard
Copied
Thanks for the information but that will not work due to the software that loads the files is looking to assign each to a side. Front = .1 Side = .2 etc. The prefix is UPC so this is a systematic funtion of the software we use to create Planograms (if your familiar with that term). Another software product had a configuration setting ...see attached
By @Gregory381864901nnt
Did you actually try the 2 scripts?
If so, please explain why this doesn't work as I tested them in Windows Photoshop and they worked for me.
I don't know if one can assign non-standard image extensions to Photoshop which is why I provided the 2 scripts.
Copy link to clipboard
Copied
Renaming files is not a solution for our problem as we have tens of thousands of Targa images that are named with .1, .2, as extentions and need to keep that format. When tryin to open in Photoshop we have to open as and select targa. It is then clunky to save as Targa with our needed extentions. Does that help you understand the issue? Ideally Photoshop should act like (or better considering price) an old version of Paint Shop Pro.
Copy link to clipboard
Copied
No, it doesn't.
Script 1 makes the files compatible with Photoshop while retaining the original numbering.
Script 2 renames the files back to their original naming after you have finished with them.
Good luck.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now