Copy link to clipboard
Copied
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.
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
You may alternatively switch off the 'Toggle dialog on/off' check box for the script's action item step in the action.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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'.
Copy link to clipboard
Copied
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?
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more