I know that this is a duplicate question, but the answers from the questions similar to it have not worked for me.
Google App Script getActiveSheet returns leftmost sheet