Re: How to make a new chart in AppleWorks 6?
Re: How to make a new chart in AppleWorks 6?
- Subject: Re: How to make a new chart in AppleWorks 6?
- From: kai <email@hidden>
- Date: Sun, 29 May 2005 15:10:42 +0100
On Sunday, May 29, 2005, at 10:50 am, Michelle Steiner wrote:
I've been able to get only this far so far.
set the clipboard to data_string
--data_string is defined earlier in the script, and it is valid data
that pastes properly into the spreadsheet. It contains two columns of
data; the left column contains the labels and the right column
contains numerical data.
tell application "AppleWorks 6"
activate
set new_Doc to (make new document with properties {document
kind:spreadsheet document})
paste
tell new_Doc
set data_bounds to data bounds of selection
make new chart
end tell
end tell
--data_bounds returns a list of two-element lists in this format:
{{"\"61\"", 0}, {"\"62\"", 5}, {"\"63\"", 9.52}}
So, where do I go from here?
It's not exactly intuitive, is it Michelle? ;-)
I think you'll find that the missing link here is 'object specifier', a
property that specifies the object (rather than the value) of a
spreadsheet's cell or named range. (It also allows us to determine the
object of a database's field or record, a drawing layer's graphic
object or a text object - but I digress...)
In this particular context (and assuming the clipboard is still loaded
with appropriate data), it might be used something like this:
----------------
tell application "AppleWorks 6"
activate
tell (make new document with properties ¬
{document kind:spreadsheet document})
paste
set cellRange to object specifier of selection
make new chart display at end with properties ¬
{range:cellRange, chart kind:bar chart}
(* modify/add chart properties as required *)
end tell
end tell
----------------
Have a great break! :-)
---
kai
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden