Jason
My feedback
3 results found
-
11 votesJason supported this idea ·
-
11 votesJason supported this idea ·
-
22 votesCompleted (Comments Open) · AdminIllustrator Engineering (Software Engineer, Adobe Illustrator) responded
We have the fix available in the latest prerelease build 26.0
Please update Illustrator using Adobe Creative Cloud application to the latest prerelease build from prerelease section
Warm Regards,
Aishwarya G GadodiaAn error occurred while saving the comment Jason shared this idea ·
Illustrator 25.4 update broke scripts that try to read XMP data that worked in previous versions of Illustrator.
It appears to be getting the error on this line:
ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');
Below is an example script to read font data that worked in 25.3, but errors loading the library in 25.4
// load XMP Library
function loadXMPLibrary() {
if (!ExternalObject.AdobeXMPScript) {
try {
ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');
} catch (e) {
alert('Unable to load the AdobeXMPScript library!');
return false;
}
}
return true;
}
// unload XMP Library
function unloadXMPLibrary() {
if (ExternalObject.AdobeXMPScript) {
try {
ExternalObject.AdobeXMPScript.unload();
ExternalObject.AdobeXMPScript = undefined;
} catch (e) {
alert('Unable to unload the AdobeXMPScript library!');
}
}
}
// list used fonts
function list_fonts () {
var doc = app.activeDocument;
var fontsInfo = [];
loadXMPLibrary ();
fontsInfo.push (getFontsInfo (doc.fullName));
unloadXMPLibrary ();
var info = fontsInfo.join ('\n\n');
return info;
}
// search used fonts
function getFontsInfo(file) {
var arr = [],
xmpFile,
oXmp,
fontNumber,
i,
path,
fontfamily,
fontface,
ns = 'http://ns.adobe.com/xap/1.0/t/pg/';
xmpFile = new XMPFile(file.fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_READ);
oXmp = xmpFile.getXMP();
fontNumber = oXmp.countArrayItems(ns, 'xmpTPg:Fonts');
xmpFile.closeFile(XMPConst.CLOSE_UPDATE_SAFELY);
if (fontNumber) {
for (i = 1; i <= fontNumber; i++) {
path = XMPUtils.composeArrayItemPath(ns, 'xmpTPg:Fonts', i);
fontfamily = oXmp.getStructField(ns, path, XMPConst.TYPE_FONT, 'fontFamily');
fontface = oXmp.getStructField(ns, path, XMPConst.TYPE_FONT, 'fontFace');
arr.push([fontfamily+' '+fontface]);
}
}
return arr.join(', ');
}
alert ("Fonts used in this document: \n" + list_fonts ());