put char 1 to 3 of second word of nDate(1,12,0) && first word of nDate(1,12,0) into he
if not((second word of he) = first word of fld "date") or force=1 then fetch he
pass openCard
end openCard
on fetch he
global found
put false into found
put "JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC" into months
if he is empty then exit fetch
if number of chars of he=5 then put "0" after char 4 of he
-- import text put proper pathname here
put "Hard Disk:Astronomy:GE-" & last word of the long date into fileName
repeat with month=1 to 12
if item month of months is in he then exit repeat
end repeat
if the shiftKey is up and number of lines of cd fld total Γëá 0 then
select text of cd fld total
doMenu "Clear Text"
end if
put month&char 5 to 6 of he into tar
open file fileName
repeat
set cursor to busy
read from file fileName until "&"
if it is empty then
exit repeat
end if
delete last char of it
if it contains tar then
exit repeat
end if
if tar < char 4 to 7 of line 2 of it then
get empty
exit repeat
end if
end repeat
close file fileName
put the number of lines of it into she
if she = 0 then
-- next search
if not (the target contains "Next") then put "No Galilean Satellite Events for this date." into line 3 of cd fld total
exit fetch
end if
if not (the target contains "Next") then
put line 1 of it && return into cd fld total
put "DATE Time(UT) SP Radii" & return into line 2 of cd fld total
end if
repeat with i=2 to she
put "(not visible)" into temp
put word 3 of line i of it into time
put (char 1 to 2 of time+(char 4 to 5 of time)/60+24-DSTcheck()) mod 24 into time
put line 4 of fld rise of cd sun + .5 into str
put line 5 of fld rise of cd sun - .5 into sts
put (line 4 of fld rise + .5) mod 24 into jr
put (line 5 of fld rise - .5) mod 24 into js
if time <str or time >sts then
if jr < 12 then
if time >jr and time <js then
put empty into temp
end if
else
if time <jr and time >js then
put empty into temp
end if
end if
end if
if (the target contains "Next" and temp is empty and cd fld total is empty) then
put line 1 of it && return&"DATE Time(UT) SP Radii" & return into cd fld total
end if
if not(the target contains "Next") or (the target contains "Next" and temp is empty) then put item month of months&&char 5 to 6 of he&&word 3 of line i of it &&" "&word 1 of line i of it&&(word 4 of line i of it)/10 && temp & return after cd fld total
if temp is empty then put true into found
end repeat
end fetch
-- part 16 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=398 top=181 right=205 bottom=437
-- title width / last selected line: 0
-- icon id / first selected line: 31949 / 31949
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Satellite
----- HyperTalk script -----
on mouseUp
get the seconds
add DSTcheck()*3600 to it
convert it to dateitems
put item 1 of it into line 3 of joe
put item 2 of it into line 1 of joe
put item 3 of it +(item 4 of it)/24 + (item 5 of it)/1440 into line 2 of joe
PutClipboard(joe)
open "JSAT"
end mouseUp
-- part 18 (field)
-- low flags: 00
-- high flags: 0007
-- rect: left=41 top=184 right=282 bottom=348
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 15036
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: total
-- part 19 (button)
-- low flags: 00
-- high flags: 8003
-- rect: left=6 top=313 right=334 bottom=87
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Today
----- HyperTalk script -----
on mouseUp
put char 1 to 3 of second word of nDate(1,12,0) && first word of nDate(1,12,0) into he
fetch he
end mouseUp
-- part 20 (button)
-- low flags: 00
-- high flags: 8003
-- rect: left=283 top=313 right=334 bottom=364
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Other Days
----- HyperTalk script -----
on mouseUp
Ask "Enter date (mon dd):"
put it into he
fetch he
end mouseUp
-- part 21 (button)
-- low flags: 00
-- high flags: A003
-- rect: left=90 top=313 right=334 bottom=171
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Tomorrow
----- HyperTalk script -----
on mouseUp
put char 1 to 3 of second word of nDate(1,12,1) && first word of nDate(1,12,1) into he
fetch he
end mouseUp
-- part 22 (button)
-- low flags: 00
-- high flags: 8003
-- rect: left=375 top=313 right=334 bottom=460
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Next Event
----- HyperTalk script -----
on mouseUp
global found
put 0 into n
put false into found
repeat until found
add 1 to n
put char 1 to 3 of word 2 of nDate(1,12,n) && word 1 of nDate(1,12,n) into he