iMacros - Random Number Generator

{ Posted on Feb 19 2010 by admin }

This iMacro uses the tool in this blog, generates a random number based on your input (to be edited in the code), and then use the number generated as the line number to be processed in your datasource.


SET !ERRORIGNORE YES
TAB T=1
TAB CLOSEALLOTHERS
TAB T=1

'Disables the pop-up for the extracted number
SET !EXTRACT_TEST_POPUP NO

'Generate a random number
URL GOTO=http://linkidol.com/random-number-generator/
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:NoFormName ATTR=ID:lownumber CONTENT=INSERT-LOWEST-NUMBER-HERE
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:NoFormName ATTR=ID:highnumber CONTENT=INSERT-HIGHEST-NUMBER-HERE
TAG POS=1 TYPE=BUTTON ATTR=ID:getit
TAG POS=1 TYPE=DIV ATTR=ID:randomnumber
TAG POS=1 TYPE=DIV ATTR=TXT:*&&ID:randomnumber EXTRACT=TXT

'Extract the generated number
SET !VAR1 {{!EXTRACT}}

'Set iMacro datasource and column number
SET !DATASOURCE datasource.csv

'You may change this depending how many columns your CSV has
SET !DATASOURCE_COLUMNS 1

'Set the selected random column
SET !DATASOURCE_LINE {{!VAR1}}

' Insert the remaining codes here

Post a Comment