RE: Coercion problem
RE: Coercion problem
- Subject: RE: Coercion problem
- From: Robert Poland <email@hidden>
- Date: Tue, 5 Jul 2005 12:00:44 -0600
Thanks to Michael Ghilissen, Michelle Steiner, Barry Wainwright, Scott Babcock
It works...
(* DrawAGraph 7/5/05
From: Michael Ghilissen <email@hidden>
gives graph of blood pressures for 14 tests after the line selected.
*)
set newxdates to {}
set Sys to {} -- values series 1
set Dia to {} -- values series 2
set myFile to "iMac
HD:Users:rpoland:Documents:clutter: Medical :BP
Monitor :BP Monitor"
display dialog "Enter number of starting Row." default answer "4"
if text returned of result "" then set startingRow to text returned of result
set AppleScript's text item delimiters to ","
tell application "Microsoft Excel"
-- if Window 1 "BP Monitor" then
-- Open myFile
-- end if
Select Worksheet "Averages"
-- if test then display dialog "The starting Row is " & startingRow
set lengthOfRange to 14 -- do 14 day plot
set xdateRange to "R" & startingRow &
"C1" & ":R" & startingRow + lengthOfRange & "C1"
set xRange to "R" & startingRow & "C3" &
":R" & startingRow + lengthOfRange & "C3"
set xRange2 to "R" & startingRow & "C5" &
":R" & startingRow + lengthOfRange & "C5"
set xdates to Value of Range xdateRange
repeat with Index from 1 to lengthOfRange
set xDay to item Index of xdates
as text -- Tuesday, January 22, 2002 12:00:00 AM
if xDay = "0" then
set a to "|" as text -- do nothing
copy a to end of newxdates
else
set a to text item 2 of xDay as text -- January 22
copy a to end of newxdates
end if
end repeat
set xSys to Value of Range xRange
repeat with Index from 1 to lengthOfRange
set x_Sys to item Index of xSys as number -- 120
copy x_Sys to end of Sys
end repeat
set xDia to Value of Range xRange2
repeat with Index from 1 to lengthOfRange
set x_Dia to item Index of xDia as number -- 70
copy x_Dia to end of Dia
end repeat
set AppleScript's text item delimiters to ""
end tell
set theValueP to {1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 13, 14} -- labels positions on x axis
set theValue0 to newxdates -- labels date series to show on x axis
set theValue1 to Sys -- values series 1
set theValue2 to Dia -- values series 2
tell application "Smile"
set c to make new graphic window with
properties {pagewidth:8.25 as inches,
pageheight:3.0 as inches}
set c1 to QuickCurve({}, theValue1, c)
QuickCurve({}, theValue2, c1's container)
set v to c1's container
-- edit the graph presentation
set v's xaxis labels to theValue0
set v's xaxis labels positions to theValueP
set v's xlabel to "Date"
set v's ylabel to "mm/Hg"
set v's name to "Blood Pressure, 14 Test Readings"
draw v's window
end tell
--
Bob Poland - Fort Collins, CO
http://www.ibrb.org/
_______________________________________________
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