Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tell application "Numbers"
- activate
- try
- if not (exists document 1) then error number 1000
- tell document 1
- try
- tell active sheet
- set the selectedTable to ¬
- (the first table whose class of selection range is range)
- end tell
- on error
- error number 1001
- end try
- tell selectedTable
- -- editing statements go here
- end tell
- end tell
- on error errorMessage number errorNumber
- if errorNumber is 1000 then
- set alertString to "MISSING RESOURCE"
- set errorMessage to "Please create or open a document before running this script."
- else if errorNumber is 1001 then
- set alertString to "SELECTION ERROR"
- set errorMessage to "Please select a table before running this script."
- else
- set alertString to "EXECUTION ERROR"
- end if
- if errorNumber is not -128 then
- display alert alertString message errorMessage buttons {"Cancel"}
- end if
- error number -128
- end try
- end tell
Advertisement
Add Comment
Please, Sign In to add comment