[ANSWERED]Calculating Nautical Sunrise & Sunset

Posted on
Wed Jun 10, 2015 6:10 pm
zurich offline
Posts: 103
Joined: Aug 11, 2014

[ANSWERED]Calculating Nautical Sunrise & Sunset

Greetings,

I have requirement to have a variable for Nautical Sunrise/Sunset similar to the built-in isDaylight. I have a a python script for calculating this each day.

I could use an on-the-fly script create (by applescript) Sunrise and Sunset Schedules to set the variable but this seems rather clunky. I would rather have it in the background as a plugin. I thought I could have the plugin checking the current time against the Nautical Sunrise and Sunset times (calculated by the python code) and when the current time is the Nautical Sunrise or Sunset time, the variable would change accordingly.

I was wundering if you could comment on this approach or perhaps make suggestion as to how I could do this more efficiently?

kind regards,

Z

Posted on
Thu Jun 11, 2015 8:40 am
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Calculating Nautical Sunrise & Sunset

Honestly, a plugin is overkill - lots of plumbing to do a relatively simple task once a day. If I were you , I'd just write a Python script (or AppleScript if you must) that runs at, say, midnight, that calculates sunrise and sunset and sets the variable. Simple, straight-forward, and not at all a hack but rather a perfectly reasonable approach.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 6 guests