Disable alerts in batch script?
How can I stop alerts from stopping my batch script?
I've found and adapted a script to do batch photomerges on a group photos that might be related. There's only one issue: Some of them aren't, and the photomerge script throws an alert ("Some images could not be aligned") and stops dead until I dismiss the dialog. That's...not automation. I tried to tell it to not display dialogs:
displayDialogs = DialogModes.NO;
alert('displayDialogs='+displayDialogs);
But that just doesn't work. (When you think about it, the second line shouldn't throw the alert telling me the value of displayDialogs, but it does).
I've tried various incantations:
app.displayDialogs
photomerge.displayDialogs
I've even put the DialogModes.NO into the photomerge script itself, but to no avail.
I guess I can perform surgery on the photomerge.jsx script itself, but all the documentation says that displayDialogs should work. I'm back on Photoshop CS6.
I also tried:
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.neverInteract
but this appears to be for a different version, as it complains that UserInteractionLevels is undefined.
I am using python to open the com object and then:
object.DoJavaScriptFile("/N/Images/panoramas/photomerger.jsx", ["a", "b"])
photomerger.jsx starts:
var runphotomergeFromScript = true;
#include "/C/Program Files/Adobe/Adobe Photoshop CS6 (64 Bit)/Presets/Scripts/Photomerge.jsx"
displayDialogs = DialogModes.NO;
alert('displayDialogs='+displayDialogs);
...
photomerge.createPanorama(jpg_list, false);
I even tried to figure out how to override alert(), but I couldn't get that to work either.
Any ideas before I hack up the script?
Thanks!
