actually we don't need any plug-in to retrieve the text layer dimensions, scripting provides all we need. Less than ten lines of scripting are required.
the key is the use of the -undocumented- "executeCommand()" application method.
we can create a new mask (default rectangular mask) around the text and retrieve its dimensions with simple math on mask vertices coords (right-left, top-bottom)
we get the command id by calling the -undocumented- findMenuCommandId(), that takes the name of the command as argument.
here is a example that illustrates this technique:
Code: Select all
{
app.executeCommand(2367); // 2367 : app.findMenuCommandId("New Mask")
var myTextLayer = app.project.activeItem.selectedLayers[0];
var myMask = myTextLayer.Masks.property(myTextLayer.Masks.numProperties);
var myVertices = myMask.maskShape.value.vertices;
var TextWidth = Math.abs(myVertices[0][0] - myVertices[3][0]);
var TextHeight = Math.abs(myVertices[0][1] - myVertices[1][1]);
alert("Size of text in pixels:\t\r\r" +
" width\t = " + TextWidth.toFixed(3) + "\r" +
" height\t = " + TextHeight.toFixed(3));
myMask.remove();
}