macros javascript window.onload 不工作

imacros javascript window.onload not working

我已经 运行 我的脚本好几次了,但无法弄清楚为什么 window.onload 不工作。我做错了什么?

 var macro = "CODE:";
 macro += "VERSION BUILD=9002379" + "\n";
 macro += "TAB T=1" + "\n";
 macro += "TAB CLOSEALLOTHERS" + "\n";
 macro += "SET !EXTRACT_TEST_POPUP YES" + "\n";
 macro += "SET !TIMEOUT_STEP 60" + "\n";
 macro += "SET !TIMEOUT_PAGE 60" + "\n";
 macro += "SET !ERRORIGNORE YES" + "\n";
 macro += "SET !DATASOURCE C:\imacros\test.csv" + "\n";
 macro += "SET !DATASOURCE_COLUMNS 1" + "\n"
 macro += "SET !DATASOURCE_LINE 1" + "\n";
 macro += "URL GOTO={{!COL1}}" + "\n";
 function addlisteners(){
 window.alert("Boo !");
 }
 window.onload = addlisteners;

 iimPlay(macro);
I am not sure what you tried to do with the script above but this code works fine.

    var macro = "CODE:";
    macro += "VERSION BUILD=9002379" + "\n";
    macro += "TAB T=1" + "\n";
    macro += "TAB CLOSEALLOTHERS" + "\n";
    macro += "SET !EXTRACT_TEST_POPUP YES" + "\n";
    macro += "SET !TIMEOUT_STEP 60" + "\n";
    macro += "SET !TIMEOUT_PAGE 60" + "\n";
    macro += "SET !ERRORIGNORE YES" + "\n";
    macro += "SET !DATASOURCE C:\imacros\test.csv" + "\n";
    macro += "SET !DATASOURCE_COLUMNS 1" + "\n"
    macro += "SET !DATASOURCE_LINE 1" + "\n";
    macro += "URL GOTO={{!COL1}}" + "\n";




    iimPlay(macro);

   addlisteners();


    function addlisteners() {
        alert("Boo !");
    }

现在怎么样?