Skip to main content
Participant
January 17, 2025
Question

Why is Extendscript Layer Text generating  when placing a faction like ¾

  • January 17, 2025
  • 1 reply
  • 776 views

I have an extendscript javascript script that has been working for 2 years, that reads from a UTP-8 XML file and fills in the text on the correct layers in Photoshop that worked on 25.9.1 On changing to 25.12.1 This now adds Â before the ¾.

 

I am using ¾ as the HTML entity in the XML file to add in the fraction. This happens on any fractions I use, but not on & or '.

 

Does anyone know why this is happening or what has changed? Or better yet how to fix it.

1 reply

c.pfaffenbichler
Community Expert
Community Expert
January 17, 2025

The easiest solution (or rather work-around) might be to remove all »Â«-s from the string before filling a layer. 

IF that is not a letter used in the text’s language, that is. 

Participant
January 17, 2025

I thought this was a great solution, but Extendscript doesn't want to replace this character. I have tested with other words using the same script and it works fine. Just not with this character

Here is the code, any thoughts would be great

function updateText(parentlayer, lyrName, textContents){
    layer = selectLayer(parentlayer, lyrName);
    if(layer != undefined)
    {        layer.textItem.contents = textContents.replace(/Â/g, '');
       
    }
}