I am brand new at applescript, actually scripting in general. I am working on a script for Apple’s Number '09 app and keep getting this error when i try to write something to any cell in a spread sheet. Here is an example of the code. Any help will be much appreciated. Thanks
tell application "Numbers"
set cell "B2" of table "Checklist" of sheet 1 of front document to 1
end tell
results:
error “Numbers got an error: AppleEvent handler failed.” number -10000
Notice in the library it lists that a cell has a name (coordinates) and value property, so you use name as a getter and value as the setter, this is how to work these things out, object properties are at your mercy.
thanks for the pointer. As long as we are conversing about this, I have been a little confused with “getting” the specified cell. Do I always have to tell the table, sheet and document? I appreciate all the tutoring thus far. The resources in this forum are quite amazing…just looking through all the tutorials and such. Glad to be part of the community.
To make it easier if you hhave multiple lines e.g.
tell application "Numbers"
set value of cell "B2" of table "Checklist" of sheet 1 of front document to 1
set value of cell "B3" of table "Checklist" of sheet 1 of front document to 1
end tell
you may consider:
tell application "Numbers"
tell front document
tell sheet 1
tell table "Checklist"
set value of cell "B2" to 1
set value of cell "B3" to 1
end tell
end tell
end tell
end tell
because you can then easily pile them into the middle, depends on how many you have.