code_junkie

Accessing cell properties in iWork Numbers

Nov 13th, 2011
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. tell application "Numbers"
  2. tell document 1
  3. repeat with i from 1 to count of sheets
  4. tell sheet i
  5. repeat with j from 1 to count of tables
  6. tell table j
  7. try
  8. set currentCell to the first cell of the selection range
  9. return name of currentCell
  10. end try
  11. end tell
  12. end repeat
  13. end tell
  14. end repeat
  15. end tell
  16. end tell
  17.  
  18. {column:column "A" of table "Table 1" of sheet "Sheet 1" of document "Untitled" of
  19. application "Numbers", alignment:center, value:0.0, background color:{59111, 59111,
  20. 59111}, text color:{0, 0, 0}, font size:10.0, vertical alignment:top, name:"A1",
  21. class:cell, font name:"HelveticaNeue", format:automatic, row:row "1" of table "Table
  22. 1" of sheet "Sheet 1" of document "Untitled" of application "Numbers", text
  23. wrap:true}
  24.  
  25. tell application "Numbers"
  26. tell document 1
  27. repeat with i from 1 to count of sheets
  28. tell sheet i
  29. repeat with j from 1 to count of tables
  30. try
  31. tell table j
  32. set currentCell to the first cell of the selection range
  33. set therow to row of currentCell
  34. set sheetNumber to i
  35. end tell
  36. end try
  37. end repeat
  38. end tell
  39. end repeat
  40. return name of sheet sheetNumber
  41. end tell
  42. end tell
Add Comment
Please, Sign In to add comment