I have a script which only works when I am in the current sheet where the code is being run. In A1, I have a checkbox whose job is to refresh api requests. So my code below clicks on the checkbox and fetches new data. So the purpose of my code is basically to click on the checkbox in A1. However, running this code only activates the checkbox but doesn't fetch the new results if I am not in the target spreadsheet. However, the moment I enter the target spreadsheet, the checkbox becomes actually "active" and not just checked. Important to mention that I use SyncWith Addon to fetch requests and it's the one placing the checkboxes in A1 for fetching new results. So my code is just to click on the checkbox inside A1.
If I am on a different sheet and run the code, it doesn't work. I have tried to use setActiveSheet() but it doesn't work. If my code can switch/jump spreadsheet tabs then that's sorted.
Screenshot of what I mean by jumping from Spreadsheet to current

TO:
function clear_paste_run() {
var s = SpreadsheetApp.openById("thespreadsheetID");
var sheet = s.getSheetByName("Test");
sheet.getRange("A1").clearContent();
var cell = sheet.getRange("A1");
cell.setFormula('=TEXT(NOW(),"HH:MM")');
var ssss = SpreadsheetApp.openById("thespreadsheetID");
var sheetSs = ssss.getSheetByName("Test");
var AG1val = sheetSs.getRange('B1').getValue(); // get the value of B1
sheetSs.getRange("B2").setValue(AG1val); // set the value of B1 to B2
var ss = SpreadsheetApp.openById("thespreadsheetID");
var ssheet = ss.getSheetByName("Test");
var testrange = ssheet.getRange('B2');
var testvalue = (testrange.getValues());
//Run Nov
if ( testvalue == '120') {
var spreadsheet = SpreadsheetApp.openById("thespreadsheetID");
SpreadsheetApp.setActiveSheet(spreadsheet.getSheets()[5]);
spreadsheet.getRange("A1").check();
}
