LOOP
Forum rules
iMacros EOL - Attention!
The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.
Thank you again for your business and support.
Sincerely,
The Progress Team
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
iMacros EOL - Attention!
The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.
Thank you again for your business and support.
Sincerely,
The Progress Team
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
LOOP
I'm trying to loop the Macro "ImageSave" 73 times. Within the macro lies another macro called "ImageSave2" that should loop 8 times then exits then starts the whole thing over. What is wrong with the following code? BTW - The script should run the macro "Cielo" only one time at the beginning of the code.
Set iim1= CreateObject ("InternetMacros.iim")
iret = iim1.iimPlay ("Cielo")
For m = 1 to 73
iret = iimInit ()
iret = iim1.iimPlay ("imagesave")
For n = 1 to 8
iret = iim1.iimPlay ("imagesave2")
Next
Next
Set iim1= CreateObject ("InternetMacros.iim")
iret = iim1.iimPlay ("Cielo")
For m = 1 to 73
iret = iimInit ()
iret = iim1.iimPlay ("imagesave")
For n = 1 to 8
iret = iim1.iimPlay ("imagesave2")
Next
Next
Code: Select all
Set iim1= CreateObject ("InternetMacros.iim")
iret = iimInit ()
iret = iim1.iimPlay ("Cielo")
For m = 1 to 73
iret = iim1.iimPlay ("imagesave")
For n = 1 to 8
iret = iim1.iimPlay ("imagesave2")
Next
Next
Romain (French)
Configuration: Windows XP Pro SP2, iOpus iMacros 5.20
Configuration: Windows XP Pro SP2, iOpus iMacros 5.20
Code: Select all
Set iim1= CreateObject ("InternetMacros.iim")
iret = iim1.iimInit ()
iret = iim1.iimPlay ("Cielo")
For m = 1 to 73
iret = iim1.iimPlay ("imagesave")
For n = 1 to 8
iret = iim1.iimPlay ("imagesave2")
Next
Next
Romain (French)
Configuration: Windows XP Pro SP2, iOpus iMacros 5.20
Configuration: Windows XP Pro SP2, iOpus iMacros 5.20
oops.... when the following macro is loop played in the browser it correctly saves each of the 8 images:
VERSION BUILD=5100314
FRAME F=9
TAG POS={{!LOOP}} TYPE=IMG ATTR=HREF:http://*.jpg
ONDOWNLOAD FOLDER=* FILE=+_image_{{!NOW:yyyymmdd_hhnnss}}
TAG POS=1 TYPE=IMG ATTR=HREF:http://*.jpg CONTENT=EVENT:SAVEITEM
BACK
But when trying to play the same macro 8 times with the following vbs script it saves the FIRST image 8 times not each of the 8 images 1 time as it should:
Set iim1= CreateObject ("InternetMacros.iim")
iret = iim1.iimInit ()
iret = iim1.iimPlay ("Cielo")
For m = 1 to 73
iret = iim1.iimPlay ("image save")
For n = 1 to 8
iret = iim1.iimPlay ("image save2")
Next
Next
VERSION BUILD=5100314
FRAME F=9
TAG POS={{!LOOP}} TYPE=IMG ATTR=HREF:http://*.jpg
ONDOWNLOAD FOLDER=* FILE=+_image_{{!NOW:yyyymmdd_hhnnss}}
TAG POS=1 TYPE=IMG ATTR=HREF:http://*.jpg CONTENT=EVENT:SAVEITEM
BACK
But when trying to play the same macro 8 times with the following vbs script it saves the FIRST image 8 times not each of the 8 images 1 time as it should:
Set iim1= CreateObject ("InternetMacros.iim")
iret = iim1.iimInit ()
iret = iim1.iimPlay ("Cielo")
For m = 1 to 73
iret = iim1.iimPlay ("image save")
For n = 1 to 8
iret = iim1.iimPlay ("image save2")
Next
Next
When one uses a script to run a loop it should loop down the POS when using the following command in the macro that the script calls right?
TAG POS={{!LOOP}} TYPE=IMG ATTR=HREF:http://*.jpg
I need to download the 8 images on a webpage so the script is running the macro 8 times. But only the first image is being downloaded ..... 8 times.
What am I doing wrong?
TAG POS={{!LOOP}} TYPE=IMG ATTR=HREF:http://*.jpg
I need to download the 8 images on a webpage so the script is running the macro 8 times. But only the first image is being downloaded ..... 8 times.
What am I doing wrong?
- Tech Support
- Posts: 4948
- Joined: Tue Sep 20, 2005 7:25 pm
- Contact:
Hi,
when you use the Play (Loop) button within iMacros, the program takes care of setting the !LOOP variable. When you loop from an external program or script, you have to take care of that yourself. iimSet() is your friend here.
Make sure that you change the variable name in the macro from !LOOP to LOOP.
Regards
---
Lasse Clausen, iOpus Support
when you use the Play (Loop) button within iMacros, the program takes care of setting the !LOOP variable. When you loop from an external program or script, you have to take care of that yourself. iimSet() is your friend here.
Code: Select all
For n = 1 to 8
iret = iim1.iimSet("-var_LOOP", CStr(n))
iret = iim1.iimPlay ("imagesave2")
Next
Regards
---
Lasse Clausen, iOpus Support