Applescript, working with arrays
Is there a way to write a list to a range? I tried the following:
+tell application "Numbers"+
+ get value of every cell of range "B2:C4" of table 1 of sheet 1 of document 1+
+ --> {1.0, 4.0, 2.0, 5.0, 3.0, 6.0}+
+ set value of every cell of range "E2:E3" of table 1 of sheet 1 of document 1 to {1.0, 2.0}+
+ --> error number -10000+
Result:
+error "Numbers got an error: AppleEvent handler failed." number -10000+
So the first weird thing is the result of the first command: I was expecting a list of lists (as in, say, Excel) instead of a flattened single list.
The second problem is that I have found no way to make the second command work. Is it really necessary to write to cells one by one?
Also, does anyone know what Apple's plans for Applescript support in Numbers are? It would be nice to also be able to script charting...
Thanks
Christian
+tell application "Numbers"+
+ get value of every cell of range "B2:C4" of table 1 of sheet 1 of document 1+
+ --> {1.0, 4.0, 2.0, 5.0, 3.0, 6.0}+
+ set value of every cell of range "E2:E3" of table 1 of sheet 1 of document 1 to {1.0, 2.0}+
+ --> error number -10000+
Result:
+error "Numbers got an error: AppleEvent handler failed." number -10000+
So the first weird thing is the result of the first command: I was expecting a list of lists (as in, say, Excel) instead of a flattened single list.
The second problem is that I have found no way to make the second command work. Is it really necessary to write to cells one by one?
Also, does anyone know what Apple's plans for Applescript support in Numbers are? It would be nice to also be able to script charting...
Thanks
Christian
MacMini Server, Mac OS X (10.6.2)