Demo-AJAX-Drag-Drop

From iMacros
Revision as of 17:36, 20 September 2007 by Mr (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This script automates drag & drop. Note that is does NOT work with fixed coordinates, rather it uses the position of certain HTML page element, as returned by the !TAGX and !TAGY variables.

 VERSION BUILD=6000808     
 TAB T=1     
 TAB CLOSEALLOTHERS 
 URL GOTO=http://visual-data.org/cgi-bin/WebObjects/Ajax.woa/2/wo/     
 SIZE X=750 Y=400    
 'Replay at lower speed so one can "see" the clicks better  
 SET !REPLAYSPEED MEDIUM
 TAG POS=1 TYPE=A ATTR=TXT:Drag<SP>and<SP>Drop<SP>Lists       
 TAG POS=1 TYPE=DIV ATTR=TXT:Drag<SP>Item<SP>#1       
 WAIT SECONDS=0.456     
  DS CMD=LDOWN X={{!TAGX}} Y={{!TAGY}}   
  WAIT SECONDS=1.392     
  DS CMD=MOVETO X=314 Y=173              
  DS CMD=MOVETO X=529 Y=152      
  DS CMD=LUP X=529 Y=152       
  DS CMD=MOVETO X=526 Y=154        
  DS CMD=MOVETO X=140 Y=234   
  TAG POS=1 TYPE=DIV ATTR=TXT:Drag<SP>Item<SP>#2    
  WAIT SECONDS=0.1      
  DS CMD=LDOWN X={{!TAGX}} Y={{!TAGY}}        
  DS CMD=MOVETO X=314 Y=173      
  DS CMD=MOVETO X=343 Y=165          
  TAG POS=1 TYPE=DIV ATTR=TXT:Drag<SP>Item<SP>#1   
  DS CMD=MOVETO X={{!TAGX}} Y={{!TAGY}}  
  DS CMD=LUP  X={{!TAGX}} Y={{!TAGY}}
  WAIT SECONDS=0.1
  TAG POS=1 TYPE=DIV ATTR=TXT:Drag<SP>Item<SP>#3    
  WAIT SECONDS=0.1      
  DS CMD=LDOWN X={{!TAGX}} Y={{!TAGY}}        
  DS CMD=MOVETO X=314 Y=173      
  DS CMD=MOVETO X=343 Y=165          
  TAG POS=1 TYPE=DIV ATTR=TXT:Drag<SP>Item<SP>#1   
  DS CMD=MOVETO X={{!TAGX}} Y={{!TAGY}}  
  DS CMD=LUP  X={{!TAGX}} Y={{!TAGY}}
  WAIT SECONDS=0.1
  TAG POS=1 TYPE=DIV ATTR=TXT:Drag<SP>Item<SP>#4    
  WAIT SECONDS=0.1      
  DS CMD=LDOWN X={{!TAGX}} Y={{!TAGY}}        
  DS CMD=MOVETO X=314 Y=173      
  DS CMD=MOVETO X=343 Y=165          
  TAG POS=1 TYPE=DIV ATTR=TXT:Drag<SP>Item<SP>#1   
  DS CMD=MOVETO X={{!TAGX}} Y={{!TAGY}}  
  DS CMD=LUP  X={{!TAGX}} Y={{!TAGY}}
  WAIT SECONDS=0.1
  TAG POS=1 TYPE=DIV ATTR=TXT:Drag<SP>Item<SP>#5    
  WAIT SECONDS=0.1      
  DS CMD=LDOWN X={{!TAGX}} Y={{!TAGY}}        
  DS CMD=MOVETO X=314 Y=173      
  DS CMD=MOVETO X=343 Y=165          
  TAG POS=1 TYPE=DIV ATTR=TXT:Drag<SP>Item<SP>#1   
  DS CMD=MOVETO X={{!TAGX}} Y={{!TAGY}}  
  DS CMD=LUP  X={{!TAGX}} Y={{!TAGY}}
  WAIT SECONDS=0.1