Question: Is there any way to debug a Spreadsheet google app script at runtime? 
Just running it through the script editor is not useful, because the function I need to debug takes the trigger event as an argument.

Answer: 
Here is a function that can test form submission trigger functions, lifted from [How can I test a trigger function in GAS?](https://stackoverflow.com/questions/16089041/how-can-i-test-a-trigger-function-in-gas/16089067#16089067).

```
function test_onFormSubmit() {
  var dataRange = SpreadsheetApp.getActiveSheet().getDataRange()
  var data = dataRange.getValues();
  var headers = data[0];
  // Start at row 1, skipping headers in row 0
  for (var row=1; row < data.length; row++) {
    var e = {};
    e.values = data[row];
    e.range = dataRange.offset(row,0,1,data[0].length);
    e.namedValues = {};
    // Loop through headers to create namedValues object
    for (var col=0; col<headers.length; col++) {
      e.namedValues[headers[col]] = e.values[col];
    }
    // Pass the simulated event to onFormSubmit
    onFormSubmit(e);
  }
}

```
Not sure what your question about, but try this.

```js
function get_color(e) {

  //var data = e.parameter.nameLabel

  var data = red;

  if (data == red){
    //...
  } else {
    //...
  }
}

```

**so you can use the debugger to test your scripts without considering events**

I hope it helps you!