Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

AppleScript get the value from cell range and set to variable

Dear All


I try get the value from each rows and each column with code below but found error.

set {begCol, endCol} to {2, 17}

set tgtCol to 1

tell application "Numbers"

tell front document

tell sheet "31Dec17"

tell table 1

set AmountVal to rows's (cellsbegValthru endCol)'s value

end tell

end tell

end tell

end tell


set Amount to AmountVal

tell application "Numbers"

activate

tell front sheet of front document


set myOriginalTable to front table


set setCols to 8

set myNewTable to makenewtablewith properties ¬

{row count:(count of AmountVal) + 1, column count:setCols, header column count:0}


set x to 2

repeat with eachAmount in Amount

set value of cell x of column "G" to eachAmount

set x to (x + 1)

end repeat

the error at below,

User uploaded file


Thanks you

MacBook Pro (13-inch, 2017, 4 TBT3), macOS High Sierra (10.13.3)

Posted on Mar 4, 2018 8:16 PM

Reply
4 replies

Mar 6, 2018 4:21 PM in response to sarit.s

Dear All


I apologized for short explain about what the script would like to do. The information are below:-


1. Get the value from column 2 - 17 in iWork (numbers).

Please consider the data

User uploaded file

Please consider the script in line

set AmountVal to rows's (cells begVal thru endCol)'s value

2. The script try to grab the data from that column and set to variable.

Please consider the script in line

Set Amount to AmountVa


3. Post to new table but in the same sheet.

Please consider the script in line

set x to 2

repeat with eachAmount in Amount

set value of cell x of column "G" to eachAmount

set x to (x + 1)

end repeat

4. The source of data will more than 400 rows. Then the script will be loop until end of records.


Thank you

AppleScript get the value from cell range and set to variable

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.