title: How do I convert this google script to work offline?
body: <p>I am trying to automate data entry while roaming offline using my Chromebook.</p>
  
  <p>I know that google drive is enabled offline and a standalone script in GAS should in theory do the trick but im not sure how to put the pieces together. So far I have the below code which works perfectly online (gets stuck in "running" offline) and I've got the GAS app installed. Any guidance would be greatly appreciated!</p>
  
  <pre><code>function onOpen() {
  var ui = SpreadsheetApp.getUi();
  // Or DocumentApp or FormApp.
  ui.createMenu('Invoice/Receipt System')
  // creates a menu item "Submit Order"
  .addItem('Record Invoice', 'menuItem1')
  .addToUi();
  }
  
  
  function menuItem1() {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var is = ss.getSpreadsheetByName("Template_Invoice");
  
    var lastID = is.getRange("j6");
    var nextID = is.getRange("j7");
  
    var lastIDValue = lastID.getValue();
  
  var source = ss.getSpreadsheetByName("Key_Invoice"); 
  // sets the 'Key_DailyInput' Sheet as source
  var target = ss.geSpreadsheetByName("DataBase_Invoice");
  // sets 'Key_DailyInput' sheet as the target for copying data to.
  var sourceData = source.getSheetValues(5,1,source.getLastRow(),15);
  // sets range to gather source 'Key_DailyInput' data by finding last row, and Line 5 to Column 15
  target.getRange(target.getLastRow()+1, 1, sourceData.length,15).setValues(sourceData);
  // finds last row of target 'Orders' and writes to +1 row past last row up to column 15 using setValues of sourceData
  
  // Following simply clears DailyInput so new data can be entered
  is.getRange('C5:c8').clearContent();
  is.getRange('G7:G8').clearContent();
  is.getRange('B12:h28').clearContent();
  is.getRange('b31:b34').clearContent();
  
  
  // increases value by +1 so next Sales Order ID is incremented by 1
  var cell = is.getRange("j6");
  var cellValue = cell.getValue();
  cell.setValue(cellValue + 1);
  
  nextID.setValue(lastIDValue + 1);
  }
  </code></pre>