try...catch statement usually not working in Ps CC 2019!
Can someone explain what is going on? I ran following script in CS6 EXTENDED and found there is no problem about. Probably that doesn't occur in any later releases prior to newest CC 2019, however that I'm not sure, but in latest CC 2018 I think that worked still smoothly.
How to fix the code it worked as should? After you ran it, it's creating 10 new documents, over-saving each for web on the desktop. When randomally within this short time I stop script by pressing ESC key there happens different things, like:
- sometimes correctly intended alert pops up!
- mostly I'm hearing beep, while script is continued!
- quite often I'm getting error: 'Command could not be completed', then after pressing enter script is continued!
$.level = 0; try{
for(i = 0; i < 10; i++) {
opn = documents.add(), opt = new ExportOptionsSaveForWeb()
opt.format = SaveDocumentType.JPEG, opt.optimized = true, opt.quality = 100
opn.exportDocument(File('~/desktop/name.jpg'), ExportType.SAVEFORWEB, opt)
}
}catch(err){alert('Operation got cancelled!')}
I reverted to 2018 twice because of some 'features' that were over my patience, now this scripting bug crosses my limit completely. If anyone knows at least some workaround please share...
I tried it in CC2018 I just installed - it's completely same, but I don't remember I ever had it with any script, why it happens?

