mingsai

Numbers Open Chosen Document

Feb 22nd, 2014
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. tell application "Numbers"
  2.     activate
  3.     try
  4.         set the chosenDocumentFile to ¬
  5.             (choose file of type ¬
  6.                 {"com.apple.iwork.numbers.numbers", ¬
  7.                     "com.apple.iwork.numbers.sffnumbers", ¬
  8.                     "com.microsoft.excel.xls", ¬
  9.                     "org.openxmlformats.spreadsheetml.sheet"} ¬
  10.                     default location (path to documents folder) ¬
  11.                 with prompt "Choose the Numbers document or Excel workbook to open:")
  12.         open the chosenDocumentFile
  13.     on error errorMessage number errorNumber
  14.         if errorNumber is not -128 then
  15.             display alert errorNumber message errorMessage
  16.         end if
  17.     end try
  18. end tell
Advertisement
Add Comment
Please, Sign In to add comment