Using current Indesign 2020; is there a way to create a text variable that divides the current object width/height by the metadata object (in frame) scale to get dimensions of the placed object in frame.
I use Indesign for proofing and am looking for a way to auto input width and height of placed art.
I have gone through all the metadata variables and nothing that I find will pull the actual dimensions from the (typically) pdf file.
Edit:
This is what I have so far:
var gb = app.activeDocument.selection[0].geometricBounds;
var up = gb[0];
var left = gb[1];
var down = gb[2];
var right = gb[3];
var artScale = app.activeDocument.selection[0].horizontalScale / 100;
var width = (right - left) / artScale;
var height = (down - up) / artScale;
var dimTextW = app.activeDocument.pages[0].textFrames.add();
var dimTextH = app.activeDocument.pages[0].textFrames.add();
var wTxtPlace = [down, left, down + 2, right];
var hTxtPlace = [up, left - 1, down, left];
dimTextW.geometricBounds = wTxtPlace;
dimTextW.contents = width;
dimTextH.geometricBounds = hTxtPlace;
dimTextH.contents = height;
Edit: Stuck trying to find the language for getting the scale for the object in the frame without directly selecting it, and adding that calculation to the textFrame.