!TAGX

From iMacros

Jump to: navigation, search

This value contains the X-coordinate of the HTML element found with the TAG command.

Value

X-coordinate in pixel.

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://www.iopus.com/imacros/demo/v6/frames/index.htm     
 FRAME F=3     
 TAG POS=1 TYPE=P ATTR=TXT:<SP>Frame3   
 PROMPT TAGX={{!TAGX}} !VAR1 TAGY={{!TAGY}}
 FRAME F=7     
 TAG POS=1 TYPE=P ATTR=TXT:*Frame7  
 PROMPT TAGX={{!TAGX}} !VAR1 TAGY={{!TAGY}}

See Also

!TAGY , !IMAGEX , !IMAGEY, DS