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

Scripting an answer for Warning Dialogue Box

New Here ,
Sep 14, 2022 Sep 14, 2022

Copy link to clipboard

Copied

 Capture.JPG

During an automated process, is there a way to script an answer to this warning dialogue box? The correct choice in the process always is "Flatten". Is there a way to automatically chose this option via a script or process, or setting so the automated process does not automatically go with "Keep Layers"? 

 

I know there is a way to supress Dialogs but is there a way to change their default answers? 

 

TOPICS
Actions and scripting , Windows

Views

310

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
Adobe
LEGEND ,
Sep 14, 2022 Sep 14, 2022

Copy link to clipboard

Copied

I don't think you can change that behavior, as it's automatically derived from selections, edit states of layers and what secondary data they contain. Depending on what you actually do you can probably use other methods and create custom dialogs if needed. This particular dialog for instance would likely not appear if you built the relevant checks into your script and then do a manual merge layers / flatten instead of relying on the pre-check done by the save functions.

 

Mylenium

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 ,
Sep 14, 2022 Sep 14, 2022

Copy link to clipboard

Copied

Can you provide a link to an image that triggers this dialog?

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
New Here ,
Sep 14, 2022 Sep 14, 2022

Copy link to clipboard

Copied

https://drive.google.com/file/d/107uNJKgaG3vBIjtBC1bcsxi75YNJszBb/view?usp=sharing

 

This was built in a new version than 22.5.6 that is running the hot folder. If you open it in 22.5+ it might not trigger the warning. = \

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 ,
Sep 14, 2022 Sep 14, 2022

Copy link to clipboard

Copied

I don't get any warning in Ps 2022 (23.5.1)... While in Ps 2021 (22.5.9) I receive the following message, which is different to your screenshot:

 

2022-09-15_07-24-09.png

 

I also receive a message about missing fonts in the text layers, which is expected.

 

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
New Here ,
Sep 14, 2022 Sep 14, 2022

Copy link to clipboard

Copied

That must be a PC/Mac difference. Yours did catch the gradient map warning and that is what triggered the warning on my end. That's why I'm looking for an automatic way to tell the warning dialog that it should always flatten so it doesn't hang up the process or worse when dialogs are supressed save out the file after removing the gradient map and making the proof wrong. 

But if there is no way to look for that dialog or change it's default behavior, there won't be away around this. Thanks for looking. 

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 ,
Sep 14, 2022 Sep 14, 2022

Copy link to clipboard

Copied

The best I can do for now is to ignore all dialogs and then you can flatten as the first step after opening.

 

There may be some internal metadata that could be searched...

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 ,
Sep 14, 2022 Sep 14, 2022

Copy link to clipboard

Copied

You can try this code:

 

// Save the current dialog display settings
var savedDisplayDialogs = app.displayDialogs;
// Disable dialog display
app.displayDialogs = DialogModes.NO;
// Open a file dialog
open(File.openDialog("Please select the file:"));
// Restore the dialogs
app.displayDialogs = savedDisplayDialogs;

 

This is for a single file, it is of course possible to open multiple files, or a folder, or hard code a specific file etc.

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
New Here ,
Sep 15, 2022 Sep 15, 2022

Copy link to clipboard

Copied

Unfortunately if you suppress the dialogues it opens the file without the gradient map before you can flatten it. Then it just flattens the incorrect appearance and saves anyway. We were trying to find a way to prevent that from happening by addressing thte dialog choice before it has the chance to open incorrectly.  Thanks for the help though. 

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 ,
Sep 15, 2022 Sep 15, 2022

Copy link to clipboard

Copied

LATEST

There are 3rd party macro tools which can record and play mouse movements/clicks and keyboard.

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
People's Champ ,
Sep 15, 2022 Sep 15, 2022

Copy link to clipboard

Copied

As an option.

Use some third party psd to tif(jpg,png,etc) converter working from the command line.

Instead of opening psd(b), run the converter with app.system() and then open the converted file.

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
New Here ,
Sep 15, 2022 Sep 15, 2022

Copy link to clipboard

Copied

That might be an option as well. Thanks.

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