• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

textItem font Error 8500: The request property does not exist

Contributor ,
Mar 01, 2022 Mar 01, 2022

Copy link to clipboard

Copied

Hi All,

I got the below error for some of the files and working fine in some other files.

 

Screenshot 2022-03-02 at 12.54.18 PM.png

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

TOPICS
Actions and scripting , macOS

Views

260

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
LEGEND ,
Mar 02, 2022 Mar 02, 2022

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 02, 2022 Mar 02, 2022

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 02, 2022 Mar 02, 2022

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 02, 2022 Mar 02, 2022

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 02, 2022 Mar 02, 2022

Copy link to clipboard

Copied

LATEST

Analyzing scripts written for you should give you the answer:

Photoshop script to change the font for Superscript(In glyph) 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines