Copy link to clipboard
Copied
I'm looking for advice on creating a script to save a copy of my .psd file as .tga. Id like to be able to name the file the same name as a file that already exists in that directory, with the goal to overwrite that file. Is that possible? Any advice would be appreciated 🙂
with(activeDocument) saveAs(fullName, new TargaSaveOptions, true)
Copy link to clipboard
Copied
Just to add, id like to select 24 bits/pixel if possible
Copy link to clipboard
Copied
with(activeDocument) saveAs(fullName, new TargaSaveOptions, true)
Copy link to clipboard
Copied
@Lewis229310445tu7 wrote:
I'm looking for advice on creating a script to save a copy of my .psd file as .tga. Id like to be able to name the file the same name as a file that already exists in that directory, with the goal to overwrite that file. Is that possible? Any advice would be appreciated 🙂
Just to be clear:
Can you post screenshots or flesh out a more detailed description or step by step?
Copy link to clipboard
Copied
I would like to retain the PSD - I am basically using photoshop to paint a car in a video game. The game looks for a .tga file sat in a specific folder, and the .tga file has to have a specific name in order to load. Hence why the script will need to overwrite the old file in this folder. I am essentially overwriting the old tga file every time i make a few changes to the paint job, so that i can see how these changes physically look on the 3d model of the car. I am currently manually hitting file > Save a copy > clicking the name of the old file and overwriting it with new .tga file which then immediately loads the paint job in game. Its not a particualarly difficult workflow but I take quite a lot of enjoyment out of painting these cars and a script like this would make the whole experience more streamlined. Thanks for any help you can offer!
Copy link to clipboard
Copied
Have you tried the script from @Kukurykus ?
It uses the same name as the PSD and will silently overwrite any existing TGA with the same name as the PSD using 24-bit colour (alpha channels are not saved with this code, however, they could be with a minor addition).
Info on saving/installing scripts here:
https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html
Copy link to clipboard
Copied
Instead of creating new thread he could find similar: looking for a save as Targa script (where like here you marked my answer as correct solution I did so now over there for SuperMerlin).
Copy link to clipboard
Copied
If the .tga has the same name as .psd then the script I offered is what you look for.