[Remind-Fans] Every Thursday except...

Tim Chase remind at tim.thechases.com
Sat Sep 19 13:46:18 EDT 2020


On 2020-09-18 17:10, Ed Blackman wrote:
> I also want to send myself a reminder the previous Friday when
> there's an event on one of those Thursdays.  That was trickier, but
> this is what I came up with:
> 
> OMIT 26 November 2020 # Thanksgiving
> REM Thu --6 SKIP SATISFY [!isomitted($T+6) && (day($T+6) < 3 ||
> day($T+6) > 9)] \ RUN send_email -s "send meeting email for [$T+6]"
> 
> I could have distributed the +6 for the > 9 test ("day($T) > 3"),
> but couldn't figure out how to do that for the other test so left
> it.
> 
> This works, but I'm not thrilled by having to sprinkle $T+6 all
> around. Is there a better way of accomplishing the same thing?

you might be able to set a variable to the most recent trigdate() and
then do some math on it to create the other event.  Something like

  OMIT Nov 26 2020 # Thanksgiving
  REM Thu SKIP SATISFY [$Td < 3 || $Td > 9] MSG Thursday thing
  IF trigvalid()
    SET meeting $T
    REM [meeting-6] RUN send_email -s "Send mail for [meeting]"
  ENDIF

Based on a quick check, it seems to do what you intend.

-tim




More information about the Remind-fans mailing list