title: onOpen-function doesn't work correct
body: <p>Script-Editor: wrote a script with the onOpen-function (see below). When started with the script-editor, it works correctly. when started when the spreadsheet is opened, I get the log of stmt 31 "Logger.log(name)", nothing else happens. Why?</p>
  
  <p>Here is the complete script:</p>
  
  <pre><code>function onOpen() {
    n0="T22 ";
    n1=n0+"aktuell"
    n2=n0+"Master"
    var y1=DayShift();
    Browser.msgBox("Returned with "+y1);
  };
  
  function DayShift() { 
    var dt=Browser.inputBox("Datum (YYMMDD) eingeben");
    if (dt=="cancel" || dt.length !=6) return("Input "+dt);
  
    var f1=GetFL(n1,0);
    if (f1=="cancel") return("F1 cancel");
    Logger.log(f1);
    var Rx=f1.getSheetByName("Sheet1").getRange("B9").getValue();
    f1.rename(n0+dt);
    Logger.log(Rx);
    Logger.log(f1.getName()+" finished");
  
    var f2=GetFL(n2,1);
    if (f2=="cancel") return("F2 cancel");
    Logger.log(f2);
    f2.getSheetByName("Sheet1").getRange("B7").setValue(Rx);
    Logger.log(f1.getName()+" finished");
  
    return("OK");
  };
  
  function GetFL(name,typ) {
    Logger.log(name);
    var fx = DocsList.find(name);
    Logger.log(name+" = "+fx.length);
    if (fx.length != 1)  return("cancel");
    if (typ==1) {
      var fy=fx[0].makeCopy(n1);
    } else {
      var fy=fx[0];
    };
    fy=SpreadsheetApp.openById(fy.getId());
    Logger.log(fy);
    return (fy);
  };
  </code></pre>