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?
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.
Can you provide a link to an image that triggers this dialog?
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. = \
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:
I also receive a message about missing fonts in the text layers, which is expected.
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.
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...
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.
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.
There are 3rd party macro tools which can record and play mouse movements/clicks and keyboard.
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.
That might be an option as well. Thanks.