Imacro DataSource错误

时间:2017-02-24 19:53:39

标签: javascript imacros

我正在尝试创建一个文件,该宏将从.csv文件中读取,但我一直收到此错误

    RuntimeError: Data source file does not exist, line 1 (Error code: -930)

这是我的.js文件

    var load;
    load =  "CODE:";
    load +=  "SET !DATASOURCE Config.csv" + "\n";
    load +=  "SET !DATASOURCE_COLUMNS 2" + "\n";
    load +=  "SET !DATASOURCE_LINE {{i}}" + "\n";
    load +=  "SET !extract {{!col2}}" + "\n";

    var startPageNumber = "";
    var Refund;
    var Donation;
    var x = 3;

    for(i=1;i<x;i++) {

        iimSet("i",i);
        iimPlay(load);
        startPageNumber = iimGetLastExtract(0);
        alert(startPageNumber);
    }

1 个答案:

答案 0 :(得分:0)

我没有意识到我需要2个斜杠“\”而我需要指定路径 OLD:

        load +=  "SET !DATASOURCE Config.csv" + "\n";

NEW

        load +=  "SET !DATASOURCE C:\\Config.csv" + "\n";