How to play a loop on iMacros browser with VBS?

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++.

Moderators: Community Moderators, iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

How to play a loop on iMacros browser with VBS?

by Gnr993 on Fri Sep 01, 2017 8:32 am

Hi.
When I run my scrips for a long period of time, I get memory leak and the software crashes.
Therefore, I want to use VBS to open and close the iMacros browser to prevent memory leak.
I know that the script should look like this:

Code: Select all
Set iim1= CreateObject ("imacros")
    iret = iim1.iimOpen()
    iret = iim1.iimPlay("‏‏name of the file.iim")
    iret = iim1.iimClose()


But it opens the software only for 1 loop.
I need it to play 1 loop, close the software, and then play the next.
Gnr993
 
Posts: 4
Joined: Fri Sep 01, 2017 8:26 am

Re: How to play a loop on iMacros browser with VBS?

by shaves on Fri Sep 08, 2017 2:39 pm

I use visual basic (vba) and run loops with iMacros all of the time. I'm assuming that your file name changes each time. The code I use would look something like this

Code: Select all

do until (some condition)
     
     doevents

    Set iim1= CreateObject ("imacros")
    iret = iim1.iimOpen()
    iret = iim1.iimPlay(varFileName)
    iret = iim1.iimClose()

    varFileName = ""

    (go get new file name)

loop


Hope this helps........
shaves
 
Posts: 56
Joined: Tue Apr 29, 2008 11:50 am


Return to Scripting and Command Line Interface

Who is online

Users browsing this forum: No registered users and 5 guests

-->