Call Macro one after one and run it for a specific number

Discussions and Tech Support related to automating the iMacros Browser or Internet Explorer from any scripting and programming language, such as VBS (WSH), VBA, VB, Perl, Delphi, C# or C++.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information:CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
winmaxservices213
Posts: 1
Joined: Wed Sep 23, 2015 9:09 pm

Call Macro one after one and run it for a specific number

Post by winmaxservices213 » Wed Sep 23, 2015 9:38 pm

Hi,

Can any one help on this?

I have 2 CSV files.

a) F:\IMACRO\99acres\user_id_and_password.csv
b) F:\IMACRO\99acres\url_to_send_message.csv

I have a macro (name:- Login) and the code is as below:-

Code: Select all

TAB T=1
TAB CLOSEALLOTHERS
SET !TIMEOUT_STEP 0
SET !EXTRACT_TEST_POPUP NO
SET !ERRORIGNORE YES
SET !DATASOURCE F:\IMACRO\99acres\user_id_and_password.csv
SET !DATASOURCE_COLUMNS 1
SET !DATASOURCE_LINE {{!LOOP}}
WAIT SECONDS=5
URL GOTO=www.99acres.com
TAG POS=3 TYPE=DIV ATTR=TXT:Login
WAIT SECONDS=15
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:NoFormName ATTR=NAME:username CONTENT={{!COL1}}
SET !ENCRYPTION NO
TAG POS=2 TYPE=INPUT:PASSWORD FORM=NAME:NoFormName ATTR=NAME:password CONTENT={{!COL2}}
TAG POS=1 TYPE=INPUT:SUBMIT FORM=NAME:NoFormName ATTR=ID:submit_query1
wait seconds=10
I have a second macro(name:- contact1) and the code is below

Code: Select all

TAB T=1
TAB CLOSEALLOTHERS
SET !TIMEOUT_STEP 0
SET !EXTRACT_TEST_POPUP NO
SET !ERRORIGNORE YES
SET !DATASOURCE F:\IMACRO\99acres\url_to_send_message.csv
SET !DATASOURCE_COLUMNS 1
SET !LOOP 1
SET !DATASOURCE_LINE {{!LOOP}} 
URL GOTO={{!COL1}}
WAIT SECONDS=5
TAG POS=1 TYPE=DIV ATTR=CLASS:lf<SP>hp5<SP>mt12<SP><SP>grey EXTRACT=TXT
TAG POS=1 TYPE=TEXTAREA FORM=NAME:sendemailsms ATTR=ONCOPY:return<SP>true;return<SP>preventCopy.fun(event,<SP>this);&&ONSCROLL:show_hide_label(this,<SP>'msg_title1')&&ONKEYUP:pg.chkMsgChars(event,this,400)&&ONFOCUS:srp.changeCssAndDefaultText(this,'C','DP');&&ONBLUR:srp.changeCssAndDefaultText(this,'B','DP');&&ID:es_meg&&CLASS:txtWd<SP>dp_in<SP>f14&&ONPASTE:return<SP>true;return<SP>preventCopy.fun(event,<SP>this);&&STYLE:margin:<SP>1px;&&NAME:msg&&NAMEINERR:Message&&VALTYPE:msg&&ATTR:pd_left_textarea CONTENT=Hi,<SP>if<SP>you<SP>are<SP>interested<SP>in<SP>Renting<SP>your<SP>for<SP>property<SP>on<SP>corporate<SP>lease,<SP>please<SP>send<SP>us<SP>your<SP>contact<SP>number<SP>by<SP>email<SP>to<SP>aradhanaestate@gmail.com<SP>with<SP>this<SP>ad's<SP>property<SP>id.<SP>We<SP>will<SP>send<SP>you<SP>the<SP>terms<SP>and<SP>conditions<SP>by<SP>email.<BR><LF><SP>
TAG POS=2 TYPE=INPUT:RADIO FORM=NAME:sendemailsms ATTR=NAME:identityRadio CONTENT=YES
TAG POS=1 TYPE=A FORM=NAME:sendemailsms ATTR=TXT:Send<SP>Email<SP>&<SP>SMS<SP>FREE&&ONCLICK:$(this).closest('form').submit();return<SP>false;&&ID:SendSmsEmailButtonId&&TITLE:Send<SP>Email<SP>&<SP>SMS&&CLASS:btn<SP>blue<SP>f15<SP>mt5&&HREF:javascript:void(0);
WAIT SECONDS=5
TAG POS=1 TYPE=DIV ATTR=ID:ThankyouBar EXTRACT=TXT
WAIT SECONDS=2
TAG POS=1 TYPE=DIV ATTR=CLASS:lf<SP>hp5<SP>mt12<SP><SP>grey EXTRACT=TXT
WAIT SECONDS=2
TAG POS=1 TYPE=DIV ATTR=CLASS:fadeSlider<SP>f13 EXTRACT=TXT
WAIT SECONDS=2
TAG POS=1 TYPE=DIV ATTR=CLASS:lf<SP>hp5<SP>mt12<SP><SP>grey EXTRACT=TXT
WAIT SECONDS=2
SAVEAS TYPE=EXTRACT FOLDER=F:\IMACRO\99acres FILE=99acres_MSG_SENT.csv
WAIT SECONDS=5
TAG POS=1 TYPE=A ATTR=TXT:Logout
I have a second macro(name:- contact2) and the code is below

Code: Select all

TAB T=1
TAB CLOSEALLOTHERS
SET !TIMEOUT_STEP 0
SET !EXTRACT_TEST_POPUP NO
SET !ERRORIGNORE YES
SET !DATASOURCE F:\IMACRO\99acres\url_to_send_message.csv
SET !DATASOURCE_COLUMNS 1
SET !LOOP 71
SET !DATASOURCE_LINE {{!LOOP}}
URL GOTO={{!COL1}}
WAIT SECONDS=5
TAG POS=1 TYPE=DIV ATTR=CLASS:lf<SP>hp5<SP>mt12<SP><SP>grey EXTRACT=TXT
TAG POS=1 TYPE=TEXTAREA FORM=NAME:sendemailsms ATTR=ONCOPY:return<SP>true;return<SP>preventCopy.fun(event,<SP>this);&&ONSCROLL:show_hide_label(this,<SP>'msg_title1')&&ONKEYUP:pg.chkMsgChars(event,this,400)&&ONFOCUS:srp.changeCssAndDefaultText(this,'C','DP');&&ONBLUR:srp.changeCssAndDefaultText(this,'B','DP');&&ID:es_meg&&CLASS:txtWd<SP>dp_in<SP>f14&&ONPASTE:return<SP>true;return<SP>preventCopy.fun(event,<SP>this);&&STYLE:margin:<SP>1px;&&NAME:msg&&NAMEINERR:Message&&VALTYPE:msg&&ATTR:pd_left_textarea CONTENT=Hi,<SP>if<SP>you<SP>are<SP>interested<SP>in<SP>Renting<SP>your<SP>for<SP>property<SP>on<SP>corporate<SP>lease,<SP>please<SP>send<SP>us<SP>your<SP>contact<SP>number<SP>by<SP>email<SP>to<SP>aradhanaestate@gmail.com<SP>with<SP>this<SP>ad's<SP>property<SP>id.<SP>We<SP>will<SP>send<SP>you<SP>the<SP>terms<SP>and<SP>conditions<SP>by<SP>email.<BR><LF><SP>
TAG POS=2 TYPE=INPUT:RADIO FORM=NAME:sendemailsms ATTR=NAME:identityRadio CONTENT=YES
TAG POS=1 TYPE=A FORM=NAME:sendemailsms ATTR=TXT:Send<SP>Email<SP>&<SP>SMS<SP>FREE&&ONCLICK:$(this).closest('form').submit();return<SP>false;&&ID:SendSmsEmailButtonId&&TITLE:Send<SP>Email<SP>&<SP>SMS&&CLASS:btn<SP>blue<SP>f15<SP>mt5&&HREF:javascript:void(0);
WAIT SECONDS=5
TAG POS=1 TYPE=DIV ATTR=ID:ThankyouBar EXTRACT=TXT
WAIT SECONDS=2
TAG POS=1 TYPE=DIV ATTR=CLASS:lf<SP>hp5<SP>mt12<SP><SP>grey EXTRACT=TXT
WAIT SECONDS=2
TAG POS=1 TYPE=DIV ATTR=CLASS:fadeSlider<SP>f13 EXTRACT=TXT
WAIT SECONDS=2
TAG POS=1 TYPE=DIV ATTR=CLASS:lf<SP>hp5<SP>mt12<SP><SP>grey EXTRACT=TXT
WAIT SECONDS=2
SAVEAS TYPE=EXTRACT FOLDER=F:\IMACRO\99acres FILE=99acres_MSG_SENT.csv
WAIT SECONDS=5
TAG POS=1 TYPE=A ATTR=TXT:Logout

a) Basically I want to login the site by extracting user id and password from csv file (user_id_and_password.csv )
b) I want to open and contact the url one by one in csv file(url_to_send_message.csv) only for 70 times then logout.
c) Then I want to login with second user id and password from line two of csv file and want to open and contact the url one by one in csv file(url_to_send_message.csv) 70 times i.e from 71st line to 140th line
d) Then I want to login with third user id and password from line three of csv file and want to open and contact the url one by one in csv file(url_to_send_message.csv) 70 times i.e from 141 line to 210th line
This will be continues process till the user id ends my csv file. I have 10 user id in my csv file.

Please help to call macro one after another. Also i am not a techie guy. please provide me a code. I troed above code but it shows error.
Post Reply