I use a reference to cell... in order to later set the value of the cell without having to go through the document:sheet:table "path". I need the name of the table of this cell in another part of the code, but I can't get it directly from the cell (the reference to the cell). Tables have the property parent but cells don't :-(.

I found something similar here properties-of-an-object-or-class but doesn't help.

The only way I found is to store the information of the table in another variable.

Any ideas to improve it?

Here is some code that works:

tell application "Numbers"
tell document 1
    tell sheet 1
        tell table 1
            (*
            more code here
            I make sure the selection range is a cell
            etc.
            *)
            set cellXref to a reference to cell (name of selection range)
            set cellXrefTable to it
            set tableXName to name of cellXrefTable --or set tableXName to name of it
        end tell
    end tell
end tell
set value of cellXref to 1000000
end tell
0

There are 0 best solutions below