Gary,
I am trying to use javascript in script editor to get the value of a range of cells from a Numbers spreadsheet. AppleScript does it with:
tell application “Numbers”
open alias “Macintosh HD:Users:danaeugene:Documents:Numbers Files:AppleScript PRACTICE2.numbers”
tell the first table of the active sheet of document 1
set theNames to value of cells in range “A1:C1”
end tell
end tell
result: {“AA1”, “BB1”, “CC1”}
I can get javascript to open the spreadsheet using:
Numbers = Application (“Numbers”);
Numbers.open(“/Users/danaeugene/Documents/Numbers Files/AppleScript PRACTICE2.numbers”);
However I have been unable to get values from cells or a range of cells. I know it must be some simple syntax error but I am stumped. I have studied the dictionary. And searched every resource that I can think of and have not come up with an example using Javascript to get cell values from a Numbers spreadsheet. Do you have any suggestions?
Thanks,
Dana Stevens
—–
Dana Stevens
I've got such an example from an episode from about 2 years ago. Maybe this will help:
Populating a Keynote Presentation From a Numbers Spreadsheet Using JavaScript.
Exactly what I needed. I should have searched MacMost more thoroughly, sorry. Thanks for being there for us.
Gary,
Studying your script and with some reference to the dictionary I was able to accomplish the task. I'm sure it's not the most elegant javascript but it works. Now I'm able to experiment and discover. Thanks again for your help.
Take care,
Dana