• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Numbers '08
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Numbers '08


  • Subject: Re: Numbers '08
  • From: Scott Lindsey <email@hidden>
  • Date: Sun, 11 Jan 2009 22:14:27 -0800

Michelle Steiner wrote:

Why doesn't this work?

tell application "Numbers"
set selectedDocument to document (item 1 of (choose from list (get name of documents)))
tell document selectedDocument
sheets
end tell
end tell

"sheets" is highlighted, with this error:

--> "Numbers got an error: Can’t make document \"Untitled\" into type integer."


The variable selectedDocument is already a document, so what you're effectively trying to do is 

tell document (document "Untitled")
sheets
end tell

I think Cocoa scripting probably first tries to see if the argument is text, and next tries to coerce it to an integer, which fails.

You want:


tell application "Numbers"
set selectedDocument to document (item 1 of (choose from list (get name of documents)))
tell selectedDocument
sheets
end tell
end tell


or

tell application "Numbers"
set selectedDocumentName to (item 1 of (choose from list (get name of documents)))
tell document selectedDocumentName
sheets
end tell
end tell

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Prev by Date: Re: Numbers '08
  • Next by Date: Re: Numbers '08
  • Previous by thread: Re: Numbers '08
  • Next by thread: How to convert number from exponential form?
  • Index(es):
    • Date
    • Thread