VBS: read textfile to variable

Information related to the use of iMacros for form filling and data upload.
Post Reply
Hannes, Tech Support

VBS: read textfile to variable

Post by Hannes, Tech Support » Wed Oct 25, 2006 12:43 pm

This piece of code reads a textfile "test.txt" and stores its content in a variable "inputData" (taken from topic http://forum.imacros.net/viewtopic.php?p=4965#4965):

Code: Select all

Dim objFileSystem, objInputFile

Set objFileSystem = CreateObject("Scripting.fileSystemObject")
Set objInputFile = objFileSystem.OpenTextFile("test.txt", 1)

' read everything in an array
inputData = objInputFile.ReadAll


msgbox inputData 
Posts: 6
Joined: Wed Jan 14, 2009 1:46 pm

Re: VBS: read textfile to variable

Post by etzel » Wed Feb 25, 2009 6:23 pm

Can this be used with the Firefox .js support with textfiles which contain conditional statements? such as checking for captcha, if found prompt for captcha, else next iimplay, on captchaprompt ok button submit, iimplay...

That would make my life a whole lot simpler
Post Reply