Photoshop scripting : check if a dialog box is displayed + close it automatically

Community Beginner ,
Feb 16, 2021 Feb 16, 2021

Copy link to clipboard

Copied

Hello, 

 

I'm trying to open several raw images with Photoshop but when a camera is not supported in this list https://helpx.adobe.com/in/camera-raw/kb/camera-raw-plug-supported-cameras.html, Ps is blocked.

I mean a dialog box is displayed (see image) Capture d’écran 2021-02-16 à 19.45.05.png

 

and this  needs a user interaction to click on "OK"

 

How can i detect if there is an open dialog box in Ps ? How can is select it ? It is app.document.window ? 

How can i automatically click on "OK" and log the error ? 

 

In order to skip displaying dialogs, i saw this in Photoshop scripting guide page 33 : https://www.adobe.com/content/dam/acom/en/devnet/photoshop/pdfs/photoshop-scripting-guide-2020.pdf 

displayDialogs = DialogModes.NO  

 

but when i try :

displayDialogs = DialogModes.NO;

alert("coco");

an alert dialog box appears. Do you know why ?

 

I saw this post but i don't know how to adapt it to my case. 

Any insight would be helpful, thanks !

 

TOPICS
Bug, How to

Views

71

Likes

translate

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

Adobe Community Professional , Feb 16, 2021 Feb 16, 2021
Try adding app. as in:   app.displayDialogs = DialogModes.NO;

Likes

translate

Translate

Translate
Adobe Community Professional ,
Feb 16, 2021 Feb 16, 2021

Copy link to clipboard

Copied

Is it a particular raw format itself, such as you can't process .CR3 files, but you can process .CR2 files?

 

Or is it that some camera model .CR2 files can be processed, while other .CR2 files can't be processed?

Likes

translate

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 Community Professional ,
Feb 16, 2021 Feb 16, 2021

Copy link to clipboard

Copied

Try adding app. as in:

 

app.displayDialogs = DialogModes.NO;

Likes

translate

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 Beginner ,
Feb 24, 2021 Feb 24, 2021

Copy link to clipboard

Copied

Hi @Stephen_A_Marsh 

I'm so sorry for my late reply. I didn't see you answers. Thanks a lot for answering ! 

It works in general but it seems that alert works differently and enforces a dialog to display. 

In fact, i understood that the camera wasn't supported by Adobe Camera Raw so an error message was displayed.

 

Thanks again for helping ! 

 

Likes

translate

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