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

Bypass warning prompts?

New Here ,
Apr 28, 2019 Apr 28, 2019

Copy link to clipboard

Copied

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

TOPICS
Actions and scripting

Views

1.3K

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

People's Champ , Apr 29, 2019 Apr 29, 2019

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 =

...

Votes

Translate

Translate
Adobe
People's Champ ,
Apr 29, 2019 Apr 29, 2019

Copy link to clipboard

Copied

What kind of warning? Can you show a screenshot?

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 ,
Apr 29, 2019 Apr 29, 2019

Copy link to clipboard

Copied

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"

1.JPG

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 ,
Apr 29, 2019 Apr 29, 2019

Copy link to clipboard

Copied

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

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 ,
Apr 29, 2019 Apr 29, 2019

Copy link to clipboard

Copied

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

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 ,
Apr 29, 2019 Apr 29, 2019

Copy link to clipboard

Copied

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-");

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 ,
Apr 29, 2019 Apr 29, 2019

Copy link to clipboard

Copied

Thank you for your suggestion. This gave me another idea which may help with my issue.

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
LEGEND ,
Sep 08, 2021 Sep 08, 2021

Copy link to clipboard

Copied

Share that idea. That may be helpful for others with similar issue.

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
LEGEND ,
Feb 27, 2022 Feb 27, 2022

Copy link to clipboard

Copied

LATEST

Your script works only when I move WScript.Sleep(200); command between if statements.

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
Adobe Employee ,
Apr 29, 2019 Apr 29, 2019

Copy link to clipboard

Copied

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.

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
LEGEND ,
Apr 29, 2019 Apr 29, 2019

Copy link to clipboard

Copied

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

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