Skip to main content
Participant
April 29, 2019
Answered

Bypass warning prompts?

  • April 29, 2019
  • 2 replies
  • 1982 views

Hello

So I have a vbscript that plays an action in photoshop, sometimes the action may have a problem with the image it's working on so it displays a warning prompt, so unless you manually click the OK button on the prompt, the script is pretty much halted and cant proceed any further.

Is there a way to suppress these prompts, or detected so we can programatically bypass it?

There's "appRef.DisplayDialogs = 3" but that only suppresses dialogs

Thank you

This topic has been closed for replies.
Correct answer r-bin

This is silly and frustrating. Other error prompts such as "unable to select" or "Unable to stroke" etc... are all thrown as errors which we can bypass or act accordingly, and not this


I can suggest a crude idea.

On windows, create a scr.js file with these contents.

var WshShell = WScript.CreateObject("WScript.Shell");

while (1)

    {

    if (WshShell.AppActivate("Adobe Photoshop")) WshShell.SendKeys ("{ENTER}");

    if (WshShell.AppActivate("-1234567890-")) { WshShell.SendKeys ("{ENTER}"); break; }

   

    WScript.Sleep(200);

    }

WshShell = null;

Run such a jsx script in Photoshop on a file without subject.

var file = new File("C:/scr.js"); // path to js script;

file.execute();

var d = new ActionDescriptor();

executeAction(stringIDToTypeID("autoCutout"), d, DialogModes.NO);

alert("", "-1234567890-");

2 replies

Tom Ruark
Inspiring
April 29, 2019

I just fixed the "select subject" can pop a warning dialog via scripting when "do not show" is turned on.

Please report other dialogs you cannot get the "do not show" option to do the right thing. They are annoying and I'm constantly squishing them as the arise. Sorry about that.

Kukurykus
Legend
April 29, 2019

That's good as I had to use in first instance other method to find whether Select Subject is possible.

Legend
April 29, 2019

What kind of warning? Can you show a screenshot?

Participant
April 29, 2019

Like this.

My vbscript runs an action to do a "select subject" from photoshop cc, but it failed to select a subject in the photo, the VBScript wont continue unless you press OK. This is not ideal when you have to process 1000s of images. Is there a way to suppress this, or whether Vbscript can detect that there's this warning and do something else?

I tried "On Error Resume Next" but doesn't work, because this prompt is not an "error"

Legend
April 29, 2019

I think it is impossible to do this at the moment.