Not sure if my reply will help at all. Taken from this answer by gglick:
%WindowSize%
will give you a window's size in pixels,%WindowPosition%
will give you its coordinates, and%WindowFrame%
will give you both. See https://wiki.keyboardmaestro.com/token/Window_Tokens for more information.