Skip to main content
Participant
September 14, 2020
Question

Script is interrupted by dialog

  • September 14, 2020
  • 3 replies
  • 805 views

I have a script which I would like to run without interruption by any dialogs, processing a number of PSD files. If there are issues/errors along the way I don't care; I just want it to continue. I set "app.displayDialogs = DialogModes.NO;" at the start of the script. However the script is interrupted periodically by popups saying "The disk copy of <file> was changed since you last opened or saved it. Do you wish to update it?" with "Cancel" and "Update" options. Is there any way around this? I want to process several hundred PSDs in my script.

This topic has been closed for replies.

3 replies

Participant
October 20, 2020

Hi JJMack,

sorry for taking so long to reply. So many things to do in my busy life, or at least that's what I tell my boss. You are quite right, try{} and catch{} blocks were all that were needed to resolve this. Thanks for the advice on this.

Unfortunately there are other popups which are causing me grief now, which are not suppressed either by the DialogModes.NO option or exception handling. One of them is the "Cannot locate linked assets" window, which according to Adobe is a fixed problem:

 

https://feedback.photoshop.com/conversations/photoshop/photoshop-suppress-cant-locate-link-assets-dialog-from-java-script/5f5f45ab4b561a3d4259431c

 

Unfortunately in 2020 it seems to me that this problem is back. I also get "Unknown error" popups and others. So I basically have to handhold my script, checking every few minutes and restarting it if necessary. But that's OK, I'm getting through them. Please let me know if there is anything else I can do though.

 

Phil

Legend
September 16, 2020
Instead of the command
app.activeDocument.save();

use
var d = new ActionDescriptor();
d.putPath(stringIDToTypeID("in"), app.activeDocument.path);
executeAction(stringIDToTypeID("save"), d, DialogModes.NO);
 
UPD.
Which command in your script causes the message to appear?
 
 
 
 
JJMack
Community Expert
Community Expert
September 14, 2020

That does not sound like it is a dialog for some command dialog your script uses. It sound like some command your  script executed ran into some condition it did not have a default way to handle. perhaps if you enclose the code try catch you can catch  this problem and have a default way to handle the problem. You may just want to ignore or take some action.

JJMack