Skip to main content
Geppetto Luis
Legend
October 2, 2019
Answered

Save file with .psdt extension

  • October 2, 2019
  • 7 replies
  • 3981 views

I need to save the file with a .psdt extension
I have seen on the web and on the adobe forum but I have not found anything on this
I would like to know if it is possible
I tried this script by editing .psd with .psdt
but I have not had positive results
can someone help me?

 

 

// script
var psdoutputFolder = Folder.selectDialog("SAVE FILE .PSD");
save();

function save(){
  var Name = app.activeDocument.name;
  var psdsaveFile = File(psdoutputFolder + "/" + Name +".psdt");
  SavePSD(psdsaveFile);
}

function SavePSD(saveFile){
  psdSaveOptions = new PhotoshopSaveOptions();
  psdSaveOptions.embedColorProfile = true;
  psdSaveOptions.alphaChannels = true;
  activeDocument.saveAs(saveFile, psdSaveOptions, true, Extension.LOWERCASE);
}

 

This topic has been closed for replies.
Correct answer Chuck Uebele

Here's a workaround, using r-bin's rename suggestion, but I didn't have to use the non-breaking space. When difining the file to be saved, I used the psd extension, because if I used the psdt one, the file would not exists, as it was saved as a psd. Then I could rename it.

#target photoshop
// script
var psdoutputFolder = Folder.selectDialog('~/desktop/');
var Name = app.activeDocument.name;
var psdsaveFile= new File()
var nameNoExtension = Name.split('.')[0];
save();

psdsaveFile.rename(nameNoExtension+'.psdt')

function save(){
  psdsaveFile = new File(psdoutputFolder + "/" + Name +".psd");
  SavePSD(psdsaveFile);
}

function SavePSD(saveFile){
    var idsave = charIDToTypeID( "save" );
        var desc1003 = new ActionDescriptor();
        var idAs = charIDToTypeID( "As  " );
            var desc1004 = new ActionDescriptor();
            var idmaximizeCompatibility = stringIDToTypeID( "maximizeCompatibility" );
            desc1004.putBoolean( idmaximizeCompatibility, true );
        var idPhtthree = charIDToTypeID( "Pht3" );
        desc1003.putObject( idAs, idPhtthree, desc1004 );
        var idIn = charIDToTypeID( "In  " );
        desc1003.putPath( idIn, new File( saveFile) );
        var idDocI = charIDToTypeID( "DocI" );
        desc1003.putInteger( idDocI, 378 );
        var idsaveStage = stringIDToTypeID( "saveStage" );
        var idsaveStageType = stringIDToTypeID( "saveStageType" );
        var idsaveSucceeded = stringIDToTypeID( "saveSucceeded" );
        desc1003.putEnumerated( idsaveStage, idsaveStageType, idsaveSucceeded );
    executeAction( idsave, desc1003, DialogModes.NO );
    }

 

7 replies

Chuck Uebele
Community Expert
Chuck UebeleCommunity ExpertCorrect answer
Community Expert
October 3, 2019

Here's a workaround, using r-bin's rename suggestion, but I didn't have to use the non-breaking space. When difining the file to be saved, I used the psd extension, because if I used the psdt one, the file would not exists, as it was saved as a psd. Then I could rename it.

#target photoshop
// script
var psdoutputFolder = Folder.selectDialog('~/desktop/');
var Name = app.activeDocument.name;
var psdsaveFile= new File()
var nameNoExtension = Name.split('.')[0];
save();

psdsaveFile.rename(nameNoExtension+'.psdt')

function save(){
  psdsaveFile = new File(psdoutputFolder + "/" + Name +".psd");
  SavePSD(psdsaveFile);
}

function SavePSD(saveFile){
    var idsave = charIDToTypeID( "save" );
        var desc1003 = new ActionDescriptor();
        var idAs = charIDToTypeID( "As  " );
            var desc1004 = new ActionDescriptor();
            var idmaximizeCompatibility = stringIDToTypeID( "maximizeCompatibility" );
            desc1004.putBoolean( idmaximizeCompatibility, true );
        var idPhtthree = charIDToTypeID( "Pht3" );
        desc1003.putObject( idAs, idPhtthree, desc1004 );
        var idIn = charIDToTypeID( "In  " );
        desc1003.putPath( idIn, new File( saveFile) );
        var idDocI = charIDToTypeID( "DocI" );
        desc1003.putInteger( idDocI, 378 );
        var idsaveStage = stringIDToTypeID( "saveStage" );
        var idsaveStageType = stringIDToTypeID( "saveStageType" );
        var idsaveSucceeded = stringIDToTypeID( "saveSucceeded" );
        desc1003.putEnumerated( idsaveStage, idsaveStageType, idsaveSucceeded );
    executeAction( idsave, desc1003, DialogModes.NO );
    }

 

Bojan Živković11378569
Community Expert
Community Expert
October 3, 2019

If your only problem is to change extension from .psd to .psdt then you can use Bridge : Tools > Batch Rename > String Substitution.

georgec82822465
Participant
June 15, 2020

This is helpful! I can only change it with Bridge. Thank you!

Legend
October 2, 2019
1. You can rename the file after saving.
2. You can make an imitation (Photoshop will understand such a file)
 

 

name + ".psdt\u200B"

 

 
 
Kukurykus
Legend
October 3, 2019
Nice to meet you on new forum 😉
Chuck Uebele
Community Expert
Community Expert
October 2, 2019

There is definately a bug, which I filed with Adobe. We'll see if they can correct it, and if so how long.

Geppetto Luis
Legend
October 2, 2019

In fact I also tried it in this sense, but isn't it?

Chuck Uebele
Community Expert
Community Expert
October 2, 2019

Seems to be a bug. I can't save a psdt file even using action manager code, although it records it.

Bojan Živković11378569
Community Expert
Community Expert
October 2, 2019

Do you need help with script or to simply save file with psdt extension? I can not help you with script perhaps smeone else will provide solution. If you want to save file manually with .psdt extension then add t after .psd when saving fie using Fie > Save As. It won't work with Photoshop action, by the way.

chlopamps
Participant
February 19, 2020

Hi, 

I am using a Mac with the most recent version of MacOS Catalina, and this is not working for me. Is this just for Windows? I've tried adding the 't' to psd when doing Save As, as well as outside of Photoshop in my file browser, and either way, when I open the file the name is filename.psdt.psd. It seems that it thinks I am trying to include the psdt part in the name and when I open the file it does not behave like a template.

seblon78
Participant
August 5, 2020

I had the same problem but came up with this:

You need to make sure you have "View all file extensions" set to ON in Finder Settings > Advanced. If you don't, MacOS will not ask if you would like to keep the new file extension but rather add psdt before the .psd extension.

 

Hope it helps 😉

 

//Seb