Skip to main content
Known Participant
March 2, 2022
Question

textItem font Error 8500: The request property does not exist

  • March 2, 2022
  • 1 reply
  • 534 views

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

This topic has been closed for replies.

1 reply

Kukurykus
Legend
March 2, 2022
Rocky@Author
Known Participant
March 2, 2022
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?

Kukurykus
Legend
March 2, 2022

Check if my suggestion about using AM instead of DOM is not the solution.