Saveas line: save files to different folders?

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.

Saveas line: save files to different folders?

by okliangnan on Wed Aug 19, 2015 8:15 pm

Hey all~
I am very new to Imacros script, I'd like to download different webpages to different folders, here are my codes:

Code: Select all
Dim iim1, iret,dummy
'initialize iMacros instance
set iim1 = CreateObject ("imacros")
iret = iim1.iimOpen()
'define array
dim names(3)
dim i
dim tobesearched
names(0)="aldrich<sp>ames"
names(1)="robert<sp>hanssen"
For i=0 to ubound(names)
Dim checkcharge
checkcharge = "TAG POS={{loopNumber1}} TYPE=A ATTR=txt:*charge*" & vbNewLine
checkcharge = checkcharge & "saveas type=htm folder={{address}} file=*" & vbNewLine
checkcharge = checkcharge & "BACK" & vbNewLine

dim recentlinenumber
'loop checks charge
recentLineNumber = 0
do while  recentlinenumber <3         
   recentLineNumber = recentLineNumber + 1
   iret = iim1.iimSet("loopNumber1", Cstr(recentLineNumber))
        iret=iim1.iimset("address","c:\"+ currentname+"\")   
        iret = iim1.iimPlayCode(checkcharge)   
loop
next



I am trying to sending variable {{address}} to macros and then iimset() {{address}} to a dynamic folder address by these two lines:
Code: Select all
checkcharge = checkcharge & "saveas type=htm folder={{address}} file=*" & vbNewLine
iret=iim1.iimset("address","c:\"+ currentname+"\")

However, it doesn't work. No folder was created.
Would you pleas help~~~
Lot of thanks!
okliangnan
 
Posts: 1
Joined: Wed Aug 19, 2015 8:07 pm

Return to Scripting and Command Line Interface

Who is online

Users browsing this forum: No registered users and 6 guests

-->