Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

.PSB file type, 'save as' cannot be done in Photoshop script?

Explorer ,
Feb 07, 2017 Feb 07, 2017

Have a Photoshop file (PSD) containing a Smart Layer .psb file.

I can replace the smart layer .psb file with another pre-saved .psb file, to produce an updated version file.

However I'm looking to create a new 'file' in script, that I want to use as the replacement .psb file.

The problem is cannot "Save As" in Photoshop Script any file as a .psb file?

Can anybody help please, or suggest a work around, such as create a .psb from scratch?

Thank you for looking.

Stephen

TOPICS
Actions and scripting
3.5K
Translate
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

Guide , Feb 07, 2017 Feb 07, 2017

function savePSB(saveFile) {

var desc1 = new ActionDescriptor();

var desc2 = new ActionDescriptor();

desc2.putBoolean( stringIDToTypeID('maximizeCompatibility'), true );

desc1.putObject( charIDToTypeID('As  '), charIDToTypeID('Pht8'), desc2 );

desc1.putPath( charIDToTypeID('In  '), new File(saveFile) );

desc1.putBoolean( charIDToTypeID('LwCs'), true );

executeAction( charIDToTypeID('save'), desc1, DialogModes.NO );

};

Translate
Adobe
Guide ,
Feb 07, 2017 Feb 07, 2017

function savePSB(saveFile) {

var desc1 = new ActionDescriptor();

var desc2 = new ActionDescriptor();

desc2.putBoolean( stringIDToTypeID('maximizeCompatibility'), true );

desc1.putObject( charIDToTypeID('As  '), charIDToTypeID('Pht8'), desc2 );

desc1.putPath( charIDToTypeID('In  '), new File(saveFile) );

desc1.putBoolean( charIDToTypeID('LwCs'), true );

executeAction( charIDToTypeID('save'), desc1, DialogModes.NO );

};

Translate
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 ,
Feb 07, 2017 Feb 07, 2017

Thanks very much, works like a treat.....

Will now have to change the title of the Thread!

Also no issue with Opening the file as .psb using the app.Open(filename) and no OpenDocumentType.

Again thanks again.

Stephen

Translate
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 ,
Jan 18, 2019 Jan 18, 2019

Hello,

  This script isn't working for me. It just doesn't do anything. No errors, but isn't bringing up a save dialog. What I'm doing is opening a file, duplicate that file and then try to run this script to bring up a 'save as' dialog, but nothing happens. What am I missing?

Translate
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
LEGEND ,
Jan 18, 2019 Jan 18, 2019

savePSB(activeDocument.path)

Translate
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
New Here ,
Dec 12, 2019 Dec 12, 2019

Hello, I was wondering what were behind the stringIDToTypeID and others code.

that seems to be more difficult more than the general guideline.  where can I find a documentation on that?

Translate
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
LEGEND ,
Dec 13, 2019 Dec 13, 2019
LATEST
Translate
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