google-apps-script SpreadsheetApp Active Sheet getActive() - Get active spreadsheet


Example

This returns the currently active spreadsheet, or null if there is none.

var currentSheet = SpreadsheetApp.getActive();
var url = currentSheet.getUrl();
Logger.log( url );