• 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 19:59:34 -0800

First the easy one:

Michelle Steiner wrote:
What I can't figure out, though is why this doesn't work:

tell application "Numbers"
set thisSheet to sheet 1 of document 1
set SheetName to name of thisSheet
set thisTable to table 1 of sheet SheetName
end tell


It's a scoping issue.  You need: 

tell application "Numbers"
set thisSheet to sheet 1 of document 1
set SheetName to name of thisSheet
set thisTable to table 1 of sheet SheetName of document 1
end tell

However, Yvan's question still stands, as there is no selection property for the document.  If you only have a single sheet and table, then yes, it's trivial.  Multiple sheets, and even better, multiple tables per sheet, complicate things.  Take a look at the Net Worth template.

I haven't been able to determine a "proper" way to do this, though I'm happy to be corrected.
I went on a wild goose chase with GUI scripting, but it was extremely slow.  This isn't pretty, but it's less complicated, and faster than GUI scripting.

tell application "Numbers"
tell document 1
repeat with s in every sheet
tell s
repeat with t in every table
tell t
if selection range exists then
return selection range
-- or do something useful
end if
end tell
end repeat
end tell
end repeat
end tell
end tell

— Scott Lindsey

 _______________________________________________
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

  • Follow-Ups:
    • Re: Numbers '08
      • From: KOENIG Yvan <email@hidden>
    • Re: Numbers '08
      • From: Michelle Steiner <email@hidden>
  • Prev by Date: Re: Script to remove AUGD from Subject
  • Next by Date: Re: Numbers '08
  • Previous by thread: Re: Numbers '08
  • Next by thread: Re: Numbers '08
  • Index(es):
    • Date
    • Thread