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

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

Explorer ,
Mar 20, 2015 Mar 20, 2015

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.

TOPICS
Actions and scripting
5.8K
Translate
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

Advisor , Mar 20, 2015 Mar 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.

Translate
Adobe
Advisor ,
Mar 20, 2015 Mar 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.

Translate
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
Advisor ,
Mar 20, 2015 Mar 20, 2015

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

Translate
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
Explorer ,
Mar 20, 2015 Mar 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.

Translate
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 ,
May 17, 2017 May 17, 2017
LATEST

For anyone who comes across this looking for how to suppress errors in Photoshop CC, I found this worked:

app.displayDialogs = DialogModes.NO;

// Your code

app.displayDialogs = DialogModes.ERROR

That's 'DialogModes', not 'DisplayModes'.

Translate
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 ,
May 17, 2017 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?

Translate
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