It would be much easier to debug if you provided your document, your explanation of what you are trying to achieve is not super clear to me. I assume you start with no data in sheet 2 and you don't care that I'm overwriting data in sheet 2 - is this true? Anyway, please go through this code and read the comments. It takes maybe 2-3 minutes on my computer to finish the script.
tell application "Numbers"
activate
-- the following code is just to show you how do I think your document looks like
make new document
tell front document
-- there should already be one sheet, let's rename it to GAMES
set name of active sheet to "GAMES"
-- create sheet TRIALS2
-- this should also create table 1
make new sheet
set name of active sheet to "TRIALS2"
-- making sure table 1 has at least 67 rows, otherwise we cannot access row 67
if (row count of table 1 of sheet "GAMES" < 67) then
set row count of table 1 of sheet "GAMES" to 67
end if
-- making sure table 1 has at least 2 columns, otherwise we cannot access column B
if (column count of table 1 of sheet "GAMES" < 2) then
set column count of table 1 of sheet "GAMES" to 2
end if
-- inserting some value into cell B67
set value of cell "B67" of table 1 of sheet "GAMES" to random number
end tell
-- this is when to start if you already have "GAMES" and "TRIALS" set up
tell front document
-- we need 2003 rows because we do 2000 repeats
set row count of table 1 of sheet "TRIALS2" to 2003
repeat with rowNumber from 3 to 2003
-- copy value of one cell to another
-- target for copy operation is cell A3, A4, A5...A2003
set value of cell ("A" & (rowNumber as text)) of table 1 of sheet "TRIALS2" to (value of cell "B67" of table 1 of sheet "GAMES")
-- generate new random value in cell B67
set value of cell "B67" of table 1 of sheet "GAMES" to random number
end repeat
end tell
end tell
Topic:
App & System Services
SubTopic:
Automation & Scripting
Tags: