Re: Numbers '08 (Selection range)
Re: Numbers '08 (Selection range)
- Subject: Re: Numbers '08 (Selection range)
- From: "Stockly, Ed" <email@hidden>
- Date: Mon, 12 Jan 2009 18:57:16 -0800
- Thread-topic: Numbers '08 (Selection range)
This version does the same thing, and may be a bit faster, but is still
pretty ugly.
Also OMM the selection range returns a gnarly looking result:
«class» "L21:M31" of table "Table 1" of sheet "11 NET STD" of document
"Bcast_Prime_Avgs_122208" of application "Numbers"
But this version returns an actual range that may be more useful.
range "L21:M31" of table "Table 1" of sheet "11 NET STD Live+SD" of document
1 of application "Numbers"
HTH,
ES
tell application "Numbers"
tell document 1
set mySelectedRanges to selection range of every table of every sheet
whose it is not missing value
repeat with thisRange in mySelectedRanges
if contents of thisRange is not missing value then
try
--return thisRange --poorly formed result
thisRange as text
on error errMsg number errNum
set oldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to {"\""}
set myRange to text item 2 of errMsg
set myTable to text item 4 of errMsg
set mySheet to text item 6 of errMsg
set myDoc to text item 8 of errMsg
set mySelection to (a reference to (range myRange of table myTable
of sheet mySheet))
set AppleScript's text item delimiters to oldDelims
return mySelection
end try
end if
end repeat
end tell
end tell
>> 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
_______________________________________________
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