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

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 !

 

Views

777

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

Try adding app. as in:

 

app.displayDialogs = DialogModes.NO;

Votes

Translate

Translate
Adobe
Community Expert ,
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?

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

Copy link to clipboard

Copied

Try adding app. as in:

 

app.displayDialogs = DialogModes.NO;

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

Copy link to clipboard

Copied

LATEST

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 ! 

 

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