tell application "Numbers"
tell document 1 set s1 to make new sheet at end with properties {name:"aaa"} set s2 to make new sheet at end with properties {name:"bbb"}
set t to make new table at end with properties {name:"sss", column count:4, row count:5} end tell
return {s1, s2, t}
end tell
The right thing would be for the new table to appear in sheet "aaa". What I am seeing instead is a new table appearing in sheet "bbb" (which is active, having just been created). AFAICT make new table always puts the table in the active sheet, regardless of tell context.
The right thing for it to do in that script is to put the table in sheet bbb because it is the active sheet and you didn't tell the script to put it anywhere else.
What you need is either of these:
set t to make new table at sheet "bbb" with properties {name:"sss", column count:4, row count:5}
Or
set t to make new table at s2 with properties {name:"sss", column count:4, row count:5}
Or
tell s2 to set t to make new table with properties {name:"sss", column count:4, row count:5}
However, the first two of those result in this error error "The variable t is not defined." number -2753 from "t"
In this line:
-- The notion that a radical is one who hates his country is naive and usually idiotic. He is , more likely, one who likes his country more than the rest of us, and is thus more disturbed than the rest of us when he sees it debauched. He is not a bad citizen turning to crime ; he is a good citizen driven to despair.--H.L Mencken
|