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

Adobe photoshop script: suddenly psdFile.save() is not working in Photoshop 24.3.0

Explorer ,
May 19, 2023 May 19, 2023

Copy link to clipboard

Copied

Hi

I am using Photoshop 23.0 and the folllowing code is working perfectly for me -

var outputFolder = new Folder("E:/Test/");
var outputPath = outputFolder.fsName;
var selectedColorProfile = "Adobe RGB (1998)";

var outputPsdFile = new File(outputPath + "\\" + "test.psd");
var designPsd = app.documents.add( UnitValue(18,'IN'), UnitValue(12,'IN'), 300, "",NewDocumentMode.RGB, DocumentFill.WHITE,1.0, BitsPerChannelType.EIGHT, selectedColorProfile );
designPsd.saveAs(outputPsdFile);
//Many other edit operations
designPsd.save();
designPsd.close();


But my friend is using Photoshop 24.3.0 and he is getting the following error at designPsd.save() line -

Untitled.jpg

This is really strange! I changed the line to -

app.activeDocument.save();
But getting the same error -
Untitled2jpg.jpg


Finally I changed the line to -

app.activeDocument.close(SaveOptions.SAVECHANGES);

This is really surprising! The very simple save() funtion is behaving differently in two version of Photoshop! Can you please explain what is going on and how to resolve it in the best possible way?

Many thanks in advance... 
TOPICS
Actions and scripting

Views

625

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 , May 19, 2023 May 19, 2023
Adobe
Community Expert ,
May 19, 2023 May 19, 2023

Copy link to clipboard

Copied

Why hasn’t your friend updated Photoshop? 

Votes

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
Community Expert ,
May 19, 2023 May 19, 2023

Copy link to clipboard

Copied

Votes

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 ,
May 19, 2023 May 19, 2023

Copy link to clipboard

Copied

Hi @c.pfaffenbichler 

Thanks a lot for your reply! But how to handle codes that would be deployed to many end users who would use many different versions of photoshop?
Should I explicitly check the specific version of photoshop before file.save() and if it's 24.3, then code differently?

Thanks again.

Votes

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
Community Expert ,
May 19, 2023 May 19, 2023

Copy link to clipboard

Copied

I don’t consider that a meaningful approach to address something like this.

The bug was fixed within less than 30 days (if I remember correctly), if some Photoshop users don’t maintain their tools properly that should not be your problem. 

 

Only when using fairly new features (like neural filters for example) in a Script would it make sense, in my opinion, to verify if the Photoshop version meets the requirements. 

Votes

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 ,
May 19, 2023 May 19, 2023

Copy link to clipboard

Copied

LATEST

Thanks again.

Votes

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