VBS: read textfile to variable

Information related to the use of iMacros for form filling and data upload.
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
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

objInputFile.Close

msgbox inputData 
etzel
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