Note that the above expression is for changing the text’s anchor point to the second character. If you want to change the anchor point of another layer to be at the second character, it’s like this:
textLayer = thisComp.layer(“CHARACTER”);
textWidth = textLayer.sourceRectAtTime().width;
numLetters = textLayer.text.sourceText.length;
characterWidth = textWidth/numLetters;
charIndex = 2;
horizAnchor = (textLayer.transform.position[0]-textLayer.transform.anchorPoint[0])+(characterWidth*charIndex)-(characterWidth*.5);
verticalAnchor = textLayer.transform.position[1]-textLayer.transform.anchorPoint[1];
[horizAnchor,verticalAnchor];