loadColorSettings breaks script in newer version of illustrator (29+)
My script starts with changing the color settings in a file using loadColorSettings. Immediately after that, it starts processing the file. In version 28, the script works fine. Starting from ver 29 (also tried with 30, same issue), the script breaks after loadColorSettings. app.activeDocument becomes empty and i get the error “There is no document”. What could be causing this?
try {
var Lvis =[];
var LP=-1;
var $doc = app.activeDocument;
var dot = $doc.name.lastIndexOf('.');
var newName= $doc.name.substring(0, dot);
bpc_Color_Settings= new File(Folder.userData+"/Adobe/Color/Settings/ISO%20Coated%20v2%20(ECI)-sRGB_bpc.csf");
tmp_Color_Settings = new File(Folder.userData+"/Adobe/Color/Settings/ISO%20Coated%20v2%20(ECI)-sRGB.csf");
if(bpc_Color_Settings.exists) loadColorSettings(bpc_Color_Settings);
else alert_w("Color Setting for BPC not found!","Error");
//The below loop does not start, because app.activeDocument is empty = "there is no document" error
for (j = 0; j < app.activeDocument.layers.length; j++)
//more code happening here
}
catch(e) {
alert_w(e.message,"Error");
// alert( e.message, "Script Alert", true);
}
