Save a PSD in another folder script

Explorer ,
Aug 24, 2022 Aug 24, 2022

Copy link to clipboard

Copied

Hi everyone. I receive the client files in EXR and JPEG format, and a folder called Delivery.
I have to open the JPEG, make the adjustments and save it in the Delivery folder as a PSD.
I have this frankenstein script that saves the psd in the same folder as the JPEG. Is it possible to make this script save the PSD in the Delivery folder?

var fullFilePath = app.activeDocument.path + "/" + app.activeDocument.name.split('.')[0] + '.psd'
var idsave = charIDToTypeID( "save" );
    var desc6436 = new ActionDescriptor();
    var idAs = charIDToTypeID( "As  " );
        var desc6437 = new ActionDescriptor();
    var idPhtthree = charIDToTypeID( "Pht3" );
    desc6436.putObject( idAs, idPhtthree, desc6437 );
    var idIn = charIDToTypeID( "In  " );
    desc6436.putPath(idIn, new File(fullFilePath));
    var idDocI = charIDToTypeID( "DocI" );
    desc6436.putInteger( idDocI, 1386 );
    var idLwCs = charIDToTypeID( "LwCs" );
    desc6436.putBoolean( idLwCs, true );
    var idsaveStage = stringIDToTypeID( "saveStage" );
    var idsaveStageType = stringIDToTypeID( "saveStageType" );
    var idsaveBegin = stringIDToTypeID( "saveBegin" );
    desc6436.putEnumerated( idsaveStage, idsaveStageType, idsaveBegin );
executeAction( idsave, desc6436, DialogModes.NO );
TOPICS
Actions and scripting

Views

70

Likes

Translate

Translate

Report

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 , Aug 24, 2022 Aug 24, 2022

Where is the delivery directory in relation to the open file?

If in the same directory, then replace the first line with:

var fullFilePath = new File( app.activeDocument.path + "/delivery/" + app.activeDocument.name.split('.')[0] + '.psd');
if (!(Folder(fullFilePath.path)).exists) (Folder(fullFilePath.path)).create();

If the level is higher, then:

var fullFilePath = new File( app.activeDocument.path.path + "/delivery/" + app.activeDocument.name.split('.')[0] + '.psd')
if (!(Folder(fullFilePath.p
...

Likes

Translate

Translate
Community Expert ,
Aug 24, 2022 Aug 24, 2022

Copy link to clipboard

Copied

Where is the delivery directory in relation to the open file?

If in the same directory, then replace the first line with:

var fullFilePath = new File( app.activeDocument.path + "/delivery/" + app.activeDocument.name.split('.')[0] + '.psd');
if (!(Folder(fullFilePath.path)).exists) (Folder(fullFilePath.path)).create();

If the level is higher, then:

var fullFilePath = new File( app.activeDocument.path.path + "/delivery/" + app.activeDocument.name.split('.')[0] + '.psd')
if (!(Folder(fullFilePath.path)).exists) (Folder(fullFilePath.path)).create();

Likes

Translate

Translate

Report

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
Explorer ,
Aug 24, 2022 Aug 24, 2022

Copy link to clipboard

Copied

LATEST

Thanks @jazz-y . It worked perfectly!

Likes

Translate

Translate

Report

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