title: How to trigger a script via clicking a cell
body: <p>I have a google spreadsheet with many tabs and I'm trying to create a dynamic Index tab.</p>
  
  <p>So far this is what I'm doing:</p>
  
  <pre><code>function jumpToSheet() {
     var ss = SpreadsheetApp.getActiveSpreadsheet();
     var sheet = ss.getSheetByName(ss.getActiveCell().getValue());
     SpreadsheetApp.setActiveSheet(sheet);
  }
  
  function populateList() {
    var sheet = SpreadsheetApp.getActiveSpreadsheet();
    var range = sheet.getRange("D:D");
    var sheets = SpreadsheetApp.getActiveSpreadsheet().getSheets();
    for (var i = 0; i &lt; sheets.length ; i++){
      cell = range.getCell(i+1, 1);
      cell.setValue(sheets[i].getName());
    }
  }
  </code></pre>
  
  <p>I create two images on my index sheet. One has assigned to it the jumpToSheet function, the other has populateList assigned to it.</p>
  
  <p>I click the second image and it populates column D with a list of all the tabs. (just a one time thing or whenever a tab is added/removed)</p>
  
  <p>To navigate, I select a tab by name in this column, then click the first image and it takes me there.</p>
  
  <p>I have two issues with this:</p>
  
  <p><strong>How do I make it a one click action?</strong> Currently I have to click the cell containing the name of the tab I want to jump to then click the image. I'd like to just click the cell if possible. Or any other solution that will only require a single click.</p>
  
  <p><strong>How do I get back to the index tab with the keyboard?</strong> I know I can jump around with ctrl+shift+pageup/down or click the horizontal lines icon in the lower left and select the top tab. But this is a bit slow for me. Is there a shortcut to go back to the first tab? Or some other way to do it quicker (preferably with the keyboard)</p>