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
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 =
Copy link to clipboard
Copied
What kind of warning? Can you show a screenshot?
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"
Copy link to clipboard
Copied
I think it is impossible to do this at the moment.
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
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-");
Copy link to clipboard
Copied
Thank you for your suggestion. This gave me another idea which may help with my issue.
Copy link to clipboard
Copied
Share that idea. That may be helpful for others with similar issue.
Copy link to clipboard
Copied
Your script works only when I move WScript.Sleep(200); command between if statements.
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.
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.