Insert Missing Steps

From iMacros
Jump to: navigation, search

As the iMacros macros are simple text files, you can add steps by copy&paste. Here's an example:


The Initial Macro

We want to automate a form (in this case it is http://demo.imacros.net/Automate/TestForm1):

The initial recording

The inital recording yields the following macro

VERSION BUILD=12.5.503.8802     
TAB T=1     
TAB CLOSEALLOTHERS     
URL GOTO=http://demo.imacros.net/Automate/TestForm1     
TAG POS=1 TYPE=SELECT ATTR=NAME:food CONTENT=2
TAG POS=1 TYPE=SELECT ATTR=NAME:drink CONTENT=2 
TAG POS=1 TYPE=SELECT ATTR=NAME:dessert CONTENT=1
TAG POS=1 TYPE=TEXTAREA ATTR=NAME:Remarks CONTENT=Thanks<SP>a<SP>lot.
TAG POS=1 TYPE=BUTTON:SUBMIT ATTR=TXT:Click<SP>to<SP>order<SP>now
'New page loaded

The Missing Step

Now we find that we missed recording the drink size. In order to add it, we record this single step which results in the following macro:

Recording the missing step
VERSION BUILD=12.5.503.8802     
TAB T=1     
TAB CLOSEALLOTHERS     
URL GOTO=http://demo.imacros.net/Automate/TestForm1     
TAG POS=2 TYPE=INPUT:RADIO ATTR=NAME:drinksize

The New Macro

Inserting the new step, we get the new, complete form filling macro:

VERSION BUILD=12.5.503.8802    
TAB T=1     
TAB CLOSEALLOTHERS     
URL GOTO=http://demo.imacros.net/Automate/TestForm1     
TAG POS=1 TYPE=SELECT ATTR=NAME:food CONTENT=2
TAG POS=1 TYPE=SELECT ATTR=NAME:drink CONTENT=2 
'here's the new step     
TAG POS=2 TYPE=INPUT:RADIO ATTR=NAME:drinksize
'the old macro continues
TAG POS=1 TYPE=SELECT ATTR=NAME:dessert CONTENT=1
TAG POS=1 TYPE=TEXTAREA ATTR=NAME:Remarks CONTENT=Thanks<SP>a<SP>lot.
TAG POS=1 TYPE=BUTTON:SUBMIT ATTR=TXT:Click<SP>to<SP>order<SP>now
'New page loaded