The renewal maintenance has officially ended for Progress iMacros effective November 30, 2023.
This Wiki site will also no longer be moderated from the Progress side.
Thank you again for your business and support.
Sincerely, The Progress Team
!TAGX
This value contains the X-coordinate of the HTML element found with the TAG command. The !TAGX/!TAGY values are automatically set after each TAG command.
The coordinates refer to the middle of the HTML element.
Value
X-coordinate in pixel.
Set By
[X] Internal
[ ] SET
Internal means that the iMacros program itself sets the value of the variable during program run. SET means that the user can set this value via the SET command inside a macro.
Examples
In this example we use the {{!TAGX}} and {{!TAGY}} values as input for two DirectScreen commands to enter text into a tricky JavaScript date selector box that can not be filled with the standard TAG command:
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:aspnetForm ATTR=ID:txtCoverStartDate CONTENT= 'Set focus on box DS CMD=CLICK X={{!TAGX}} Y={{!TAGY}} 'Send text DS CMD=KEY X={{!TAGX}} Y={{!TAGY}} CONTENT=11/01/2009
Example macros: Demo-AJAX-Drag-Drop , Demo-AJAX-Tree
!TAGX also works within frames. It returns the absolute coordinates (= relative to the browser window, not relative to the frame).
URL GOTO=http://demo.imacros.net/Automate/Frames FRAME F=3 TAG POS=1 TYPE=INPUT:TEXT ATTR=* CONTENT=F3 PROMPT TAGX={{!TAGX}} !VAR1 TAGY={{!TAGY}} FRAME F=7 TAG POS=1 TYPE=INPUT:TEXT ATTR=* CONTENT=F7 PROMPT TAGX={{!TAGX}} !VAR1 TAGY={{!TAGY}}
Related forum post: How can I extract the position of an HTML element?