The spreadsheet I am working off of has about 10 sheets/pages.
The script is supposed to take user input from a gui and input it into the currently viewed sheet/page's next available cell.
The issue I am encountering is that I am trying to activate the currently viewed sheet/page using .getSheetByName() but the desired sheet will change dynamically. I can only get it to work when I hard code a string such "Sheet1" - but this is subject to change. I tried assigning a variable such as var sheetName = ss.getName() of the currently viewed sheet/page and then pass it into ss.getSheetByName(sheetName); but it won't accept any variables, only strings AFAIK - Any advice or work arounds?