Re: Numbers '08
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