Copy link to clipboard
Copied
Hi All,
I got the below error for some of the files and working fine in some other files.
Code for reference
convertRXLayers(app.activeDocument);
function convertRXLayers(doc){
for (var m = doc.layers.length-1; m >= 0; m--){
var myLayerInvisible = 'FALSE'
var theLayer = doc.layers[m];
if(theLayer.visible == false) {
myLayerInvisible = 'TRUE'
}
if (theLayer.typename === 'ArtLayer'){
if(theLayer.kind == LayerKind.TEXT) {
//try{
if(theLayer.textItem.font.indexOf("SFPro") > -1){//this line got error
convertToShape(theLayer);
if(myLayerInvisible === 'TRUE'){
app.activeLayer = theLayer
app.activeLayer.visible = false
}
}
// }catch(e){}
}
else{
continue
}
}
else{
convertRXLayers(theLayer);
}
}
}
Thanks
Copy link to clipboard
Copied
Copy link to clipboard
Copied
if(theLayer.textItem.font.indexOf("SFPro") > -1)
Any problem with the above code, actually I got the error on this line only, but it works for some of the file. Could you please anyone help me out?
Copy link to clipboard
Copied
Check if my suggestion about using AM instead of DOM is not the solution.
Copy link to clipboard
Copied
Hi Kukurykus,
Could you please share the AM code for getting the font names from the active document text layers?
Thanks
Copy link to clipboard
Copied
Analyzing scripts written for you should give you the answer:
Photoshop script to change the font for Superscript(In glyph)