Before using the plugin I used an Applescript to determine the moon phase,
which of course is also defunct.
Hoping there might be a Python version of this script to return a numeric description of the current moon phase?
- Code: Select all
tell application "IndigoServer"
set theYear to year of (current date)
set theMonth to month of (current date) as integer
set theDay to day of (current date)
if (theMonth = 1) then
set theDay to theDay - 1
else if (theMonth = 2) then
set theDay to theDay + 30
else
set theDay to theDay + 28 + (theMonth - 2) * 3059 / 100
end if
set g to (theYear - 1900) mod 19 + 1
set e to (11 * g + 18) mod 30
if (((e = 25) and (g > 11)) or (e = 24)) then
set e to e + 1
end if
set fullness to ((((e + theDay) * 6 + 11) mod 177) / 22) as integer
if (fullness = 8) then set fullness to 0
set value of variable "MoonPhase" to fullness
end tell
Thanks,
Carl