6 Replies Latest reply: Nov 13, 2013 3:55 AM by Peter Payne
Ratz0246 Level 1 (0 points)
Hi all,

How can I get the row number of a selection if I don't know the range selected? I need it to store in variable.

I've tried in many ways, but unsuccesfully.

Thank's in advance.

Imac, Mac OS X (10.6.6), Numbers 09
  • Level 8 (41,790 points)
    Ratz0246 wrote:
    Hi all,

    How can I get the row number of a selection if I don't know the range selected? I need it to store in variable.


    There is an answer to this question in quite half the scripts which I posted here.

    Search for the string *_script AND yvan_* to reach some of them.

    Yvan KOENIG (VALLAURIS, France) mercredi 9 février 2011 17:04:12
  • Jerrold Green1 Level 7 (29,960 points)
    Ratz,

    Is this an Applescript question?

    Jerry
  • Level 8 (41,790 points)
    If you already know the document's name, the sheet's name and the table's name, the easy way is :

    --

    --Here you may replace the three values by the current ones
    set dName to 1
    set sName to 1
    set tName to 1

    tell application "Numbers" to tell document dName to tell sheet sName to tell table tName
    tell first cell of the selection range to set {rowNum1, columnNum1} to {address of its row, address of its column}
    tell last cell of the selection range to set {rowNum2, columnNum2} to {address of its row, address of its column}
    end tell
    --


    Yvan KOENIG (VALLAURIS, France) mercredi 9 février 2011 17:22:21
  • Ratz0246 Level 1 (0 points)
    Thanks a lot Yvan.
  • Ratz0246 Level 1 (0 points)
    Yes Jerry, it is. Sorry for my bad description.
  • Peter Payne Level 1 (5 points)

    Just wanted to say thanks, Koenig, once again your posts have saved my AS.

     

    (AS meaning Applescript. A little scripting joke there...)