Passing a variable to use as the folder location

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.

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.

Passing a variable to use as the folder location

by psmalling on Thu Mar 30, 2017 4:11 am

Hi All,

I have a SAVEAS command in my vbscript. Cell B4 in sheet1 contains the full url and I've set this cell as a variable using iim1.iimSet("loc", Cells(4, 2).Value).

I want to pass the {{loc}} variable to the FOLDER= part of the command and I thought I could do this by just using FOLDER={{loc}} however when playing the macro the script errors. I can pass a variable for FILE={{name}} without any issues.

Does iMacros not allow variables to be used when setting the folder location?

Thanks for your help in advance.
psmalling
 
Posts: 10
Joined: Wed Nov 23, 2016 8:38 am

Re: Passing a variable to use as the folder location

by psmalling on Mon Apr 24, 2017 8:05 am

Sorry I forgot the config info.

Windows 7
iMacros v11.5.498.2403
Internet Explorer 11
MS Excel 2013
psmalling
 
Posts: 10
Joined: Wed Nov 23, 2016 8:38 am

Re: Passing a variable to use as the folder location

by chivracq on Mon Apr 24, 2017 6:36 pm

psmalling wrote:Hi All,

I have a SAVEAS command in my vbscript. Cell B4 in sheet1 contains the full url and I've set this cell as a variable using iim1.iimSet("loc", Cells(4, 2).Value).

I want to pass the {{loc}} variable to the FOLDER= part of the command and I thought I could do this by just using FOLDER={{loc}} however when playing the macro the script errors. I can pass a variable for FILE={{name}} without any issues.

Does iMacros not allow variables to be used when setting the folder location?

Thanks for your help in advance.

psmalling wrote:Sorry I forgot the config info.
Code: Select all
Windows 7
iMacros v11.5.498.2403
Internet Explorer 11
MS Excel 2013

Oh...!, good...!, now we are "Friends" I guess, ah-ah...! :D
(Sorry, but Reason why I never reacted to any of your Threads..., only checked for hidden Spam..., oops...!)

=> Hum, OK, mention your FCI in your 2 previous Threads as well, and post "maybe" some Update in those 2 Threads as they are already 4 and 5 months old, if you are still looking for a Solution and how you've progressed since..., or post yours if you (hopefully) managed to solved them, and I'll have a look at all your Threads..., even if hum, you use VB Scripts, not my Specialty, but I can have a look and do a bit of "Thinking", you never know... :idea:

EDIT:
Hum, read your OP..., and if that can motivate you, I think I know the Answer/Solution to your Pb in this current Thread already, ah-ah...! 8)
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6474
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Passing a variable to use as the folder location

by psmalling on Tue Apr 25, 2017 8:11 am

Thanks Chivraq.

My other posts are probably redundant now as I managed to find the answers on the iMacros site.

It would be great if you do know the answer to my current problem as I've tried everything.

Thanks in advance.
psmalling
 
Posts: 10
Joined: Wed Nov 23, 2016 8:38 am

Re: Passing a variable to use as the folder location

by chivracq on Tue Apr 25, 2017 9:34 am

psmalling wrote:Thanks Chivraq.

My other posts are probably redundant now as I managed to find the answers on the iMacros site.

It would be great if you do know the answer to my current problem as I've tried everything.

Thanks in advance.

"... as I managed to find the answers on the iMacros site."
=> Yeah, but that's exactly the Purpose of sharing your Solution to make those Threads useful for other Users searching the Forum...! :idea:
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6474
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Passing a variable to use as the folder location

by psmalling on Wed Apr 26, 2017 12:49 am

Hi Chivracq,

I've now updated the other posts. Could I please have the answer :D ?
psmalling
 
Posts: 10
Joined: Wed Nov 23, 2016 8:38 am

Re: Passing a variable to use as the folder location

by chivracq on Wed Apr 26, 2017 6:19 am

psmalling wrote:Hi Chivracq,

I've now updated the other posts. Could I please have the answer :D ?

Yep, good, Thanks... :D

Well for this current Thread, I suspect you need to escape the Backslashes for your Folder Path in your Cell for your 'loc' Var.
=> Try using Double Backslashes for the Path, or Forward Slashes or Double Forward Slashes should work as well... :idea:
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6474
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Passing a variable to use as the folder location

by psmalling on Wed Apr 26, 2017 8:49 am

Hi Chivracq,

Thanks for your help.

I managed to resolve this but by keeping the single backslashes. The issue was with the naming convention of the path as I had input <SP> to replace the spaces as you need to do this when hard coding the path in VBA. When I took these out the extract file was created and saved in the location I set as the variable.

You probably would have noticed it straight away if I had attached an example of the path I was using. :D
psmalling
 
Posts: 10
Joined: Wed Nov 23, 2016 8:38 am

Re: Passing a variable to use as the folder location

by chivracq on Wed Apr 26, 2017 10:38 am

psmalling wrote:Hi Chivracq,

Thanks for your help.

I managed to resolve this but by keeping the single backslashes. The issue was with the naming convention of the path as I had input <SP> to replace the spaces as you need to do this when hard coding the path in VBA. When I took these out the extract file was created and saved in the location I set as the variable.

You probably would have noticed it straight away if I had attached an example of the path I was using. :D

OK, good to hear, and indeed, Spaces / '<SP>' was the next "Item" I would have asked you to play with, in combination with Single/Double Quotes that might have needed to be escaped as well if you were enclosing your Path with Double Quotes... But providing some Example would have sped up the Process indeed... (together with the exact Error Msg that you had not mentioned as well...)
Using Forward Slashes for Paths with iMacros is good Practice anyway btw, even with Win32/64 OS'es where it "works", you avoid the Pb of having to escape Backslashes when using '.js' or '.vbs'/'.vba' Scripts, they are required anyway for MacOS and Linux Environments...

But remember to mention your FCI directly next time you open a Thread (or post for the first time in some existing Thread), i don't react otherwise, ah-ah...! :wink:
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6474
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)


Return to General Support & Discussions

Who is online

Users browsing this forum: No registered users and 9 guests

-->