There is this IMacro scripting tool, if you want to automate some web page visits by using javascript.
I would like to have my javascript to read from a local .txt file (not a .cvs file and not well formatted.. I would like to search in it probably with a regular expression..) and based on that reading, the script will do some job in IMacros.. (e.g call some web site url etc..)
Do you guys have any idea how this can be done ? I am doing everything local and that is my local browser reading from my local hard drive.. it should be somehow possible.. but how ?
Yes you can do it with imacros, but you need to call it from javascript.js file. load your content as one block, then you can use javascript indexOf method to find the string in the text and perform if statement. Text example (inside your txt file): "hello world!"
var load;
load = "CODE:";
load += "set !extract null" + "\n";
load += "SET !DATASOURCE text.txt" + "\n";
load += "SET !DATASOURCE_COLUMNS 1" + "\n";
load += "SET !DATASOURCE_LINE 1" + "\n";
load += "SET !extract {{!col1}}" + "\n";
iimPlay(load);
var s=iimGetLastExtract(0);
var index=s.indexOf("w");
if (index>0){
do your code;
}