I always advise to avoid having like data in multiple places, such as a similarly structured tables on different sheets. That makes it hard to analyze your data as a whole as it's harder to combine the data in all those tables. Usually it's more efficient to keep your data all together and use filters and formulas or Pivot Tables to pull out subsets and subtotals.
And like Camelot, I also don't like to use GUI scripting unless I have to.
However, if you have a system that is working for you (perhaps you have a monthly financial model in a specific format) and you don't want to change your structure then you can easily automate the "duplication" of a table, using names you have prepared, by using a script like this:
set newSheetNames to {"1/3/25", "1/17/25", "1/31/25"} -- add more as needed within the AppleScript list
tell application "Numbers"
activate
tell front document
set tempSheet to first sheet
set active sheet to tempSheet
repeat with aNewSheetName in newSheetNames
tell application "System Events"
-- deselect all
keystroke "a" using {command down, shift down}
delay 0.1
-- select all objects (tables, text items, etc.)
keystroke "a" using {command down}
delay 0.1
-- copy the objects
keystroke "c" using {command down}
end tell
delay 0.1
set newSheet to make new sheet with properties {name:aNewSheetName}
tell newSheet
delete every table
tell application "System Events"
keystroke "v" using {command down}
end tell
end tell
end repeat
end tell
end tell
USAGE:
- Copy-paste the above script into Script Editor (in Applications/Utilities)
- Have your Numbers document open and make the first sheet the way you want it, leaving the formulas you want intact but with the old data cleared out.
- Click the triangle 'Run' button in Script Editor.
Your new sheets should appear. (If you have trouble try slightly increasing the delay.)
SG