JavaScript READ from .txt file the iMacros code

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.

JavaScript READ from .txt file the iMacros code

by Colibry on Fri Mar 06, 2015 5:06 pm

How can I read the imacros code from .txt file and insert it in JS code?

I tried this txt code


Code: Select all
CODE:SET !ERRORIGNORE YES \n URL GOTO=www.google.com


But I get this error message.

Code: Select all
SyntaxError: wrong format of SET command, line 1 (Error code: -910)


But when i put the same code in JS code like this it works.

Code: Select all
iimPlay("CODE:SET !ERRORIGNORE YES \n URL GOTO=www.google.com");
Colibry
 
Posts: 48
Joined: Sun Sep 25, 2011 11:47 am

Re: JavaScript READ from .txt file the iMacros code

by Klemik on Sun May 10, 2015 8:14 am

\n means new line
You can either:

.iim
Code: Select all
SET !ERRORIGNORE YES
URL GOTO=www.google.com


.js
Code: Select all
macro="CODE:\n"
macro+="SET !ERRORIGNORE YES\n";
macro+="URL GOTO=www.google.com";
iimPlay(macro);


910 code means Syntax Error, and that would mean that the "\n" is not recognized as any command - simply hit enter instead.
http://imacrosbots.weebly.com/
Klemik
 
Posts: 36
Joined: Sun Dec 07, 2014 12:14 pm


Return to Scripting and Command Line Interface

Who is online

Users browsing this forum: No registered users and 3 guests

-->