print #h, "!origin? columnVar rowVar" ;

This command causes the current text window origin to be returned.  The origin is the upper left corner of the texteditor or textwindow.  When a text window is first opened, the result would be row 1, column 1.  The result is contained in the variables rowVar and columnVar.

print #handle, "!origin column row" ;

This command forces the origin of the window to be row and column.  This means that the row and column specified will appear in the upper left corner of the texteditor or text window.  Row and column must be literal numbers.  To  use variables for these values, place them outside the quotation marks, preserving the blank spaces, like this:

print #handle, "!origin ";column;" ";row