Skip to main content
Known Participant
March 20, 2015
Answered

How to get rid of confirmation dialog on actions with scripts (multi path delete)?

  • March 20, 2015
  • 2 replies
  • 5805 views

I'm trying to use a script in actions to clear all paths, from the web found the "activeDocument.pathItems.removeAll();" and it works nicely when invoked from script menu with no dialogs at all but when I try to use it in actions it always pops a dialog box asking for confirmation if I really want to delete  "Path whatever".

Any help on how to run this actions without dialog box would be much appreciated.

Ty in advance.

This topic has been closed for replies.
Correct answer xbytor2

Try

   app.displayDialogs = DisplayModes.ERROR;

or

   app.displayDialogs = DisplayModes.NO;

In either case, you probably want to reset it back to its original state when you're done.

2 replies

christophe70958584
Participant
May 17, 2017

hi there, is this script also working on PS CC 2017? If yes, could you do a workaround how to create script and let it run on PS?

xbytor2Correct answer
Inspiring
March 20, 2015

Try

   app.displayDialogs = DisplayModes.ERROR;

or

   app.displayDialogs = DisplayModes.NO;

In either case, you probably want to reset it back to its original state when you're done.

Inspiring
March 20, 2015

You may alternatively switch off the 'Toggle dialog on/off' check box for the script's action item step in the action.

Known Participant
March 20, 2015

Ok, ty but I'm new to scripting, dont have any background and just trying to figure this stuff out now.

Would that mean that if I include those first lines in my script would they turn off all future Photoshop dialog boxes off?If so would I get away with something like:

app.displayDialogs = DisplayModes.NO;

activeDocument.pathItems.removeAll();

app.displayDialogs = DisplayModes.YES


BTW: Turning dialog box off in actions check box for some reason doesnt work for me, always get pop-up confirmation window, but weird part is it only pops-up when script is ran trough an action.

Running Photoshop CC 2014.



Ty for the help.

EDIT: Well, the "app.displayDialogs = DisplayModes.NO" worked just fine. Dont know if I need to turn it on after or even if its the right syntax but included the "YES" option in the end anyway, its working fine so problem solved. Tks a lot.