I am working on a JXA script that will be used to copy tables from an existing Numbers sheet, and then paste them into a newly created sheet (in the same document) before making some modifications to individual cell values. I have most of what I need working, but have been unable to figure out how to change the active sheet from the source sheet to the destination sheet (or any sheet).
I have tried the following;
Numbers.documents[0].sheets.byName({name: currentSheet}).activate
It seems to execute (there are no errors), but nothing happens in Numbers. The active sheet does not change. I have the script working in AppleScript using
set active sheet to sheet currentSheet
Any help is appreciated.