<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:webfeeds="http://webfeeds.org/rss/1.0">
  <channel>
    <title>Script on staticnotes.org</title>
    <link>/tags/script/</link>
    <webfeeds:icon>https://staticnotes.org/logo.png</webfeeds:icon>
    <webfeeds:logo>https://staticnotes.org/logo.png</webfeeds:logo>
    <description>Recent content in Script on staticnotes.org</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-US</language>
    <lastBuildDate>Sun, 16 Aug 2026 00:00:00 +0000</lastBuildDate><atom:link href="/tags/script/index.xml" rel="self" type="application/rss+xml" /><image>
      <url>https://staticnotes.org/logo.png</url>
      <title>staticnotes.org</title>
      <link>/tags/script/</link>
    </image>
    
    <item>
      <title>TIL how to trigger notifications in Thunderbird for specific emails</title>
      <link>/til/2026/8/thunderbird-notifications/</link>
      <pubDate>Sun, 16 Aug 2026 00:00:00 +0000</pubDate>
      
      <guid>/til/2026/8/thunderbird-notifications/</guid>
      <description>&lt;p&gt;Some training sessions in my triathlon club are very popular. The weekly swim sessions in the winter and some of the longer rides on summer weekends are limited to a few people per group. There are usually five groups for different fitness levels.&#xA;People in my club are really fast at signing up, but there are always some who drop out a day or a few hours before the training session. If I didn&amp;rsquo;t sign up quickly enough I usually try to grab one of those last-minute spots. But even for those you have to be quick. I usually have between 1-5 min to react after a drop out before it gets snatched by somebody else.&lt;/p&gt;&#xA; &lt;h2 id=&#34;problem&#34;&gt;&#xA;  &lt;a href=&#34;#problem&#34; class=&#34;header-link&#34;&gt;&#xA;    Problem&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&lt;p&gt;The notifications for available spots usually come during work hours via email from the booking system. I want to set up the email client on my MacBook to send me a notification as soon as such an email arrives.&lt;/p&gt;&#xA; &lt;h2 id=&#34;solution&#34;&gt;&#xA;  &lt;a href=&#34;#solution&#34; class=&#34;header-link&#34;&gt;&#xA;    Solution&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&lt;p&gt;There is no built-in feature for notifications for specific emails. But I managed to set it up using the Thunderbird Extension &lt;code&gt;FiltaQuilla&lt;/code&gt; and an osascript one-liner.&lt;/p&gt;&#xA; &lt;h3 id=&#34;filtaquilla-extension&#34;&gt;&#xA;  &lt;a href=&#34;#filtaquilla-extension&#34; class=&#34;header-link&#34;&gt;&#xA;    FiltaQuilla extension&#xA;  &lt;/a&gt;&#xA;&lt;/h3&gt;&lt;p&gt;In Thunderbird install the &#xA;&lt;a href=&#34;https://services.addons.thunderbird.net/en-US/thunderbird/addon/filtaquilla/&#34; &#xA;&#xA;    target=&#34;_blank&#34;&#xA;    &gt;FiltaQuilla&#xA;    &#xA;        &lt;span style=&#34;white-space: nowrap&#34;&gt;&amp;thinsp;&lt;svg&#xA;            style=&#34;height: 0.7em; width: 0.7em; padding-left: -0.2em;&#34; focusable=&#34;false&#34; data-prefix=&#34;fas&#34; data-icon=&#34;external-link-alt&#34;&#xA;            class=&#34;svg-inline--fa fa-external-link-alt fa-w-16&#34; role=&#34;img&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&#xA;            viewBox=&#34;0 0 512 512&#34;&gt;&#xA;            &lt;path fill=&#34;currentColor&#34;&#xA;                d=&#34;M432,320H400a16,16,0,0,0-16,16V448H64V128H208a16,16,0,0,0,16-16V80a16,16,0,0,0-16-16H48A48,48,0,0,0,0,112V464a48,48,0,0,0,48,48H400a48,48,0,0,0,48-48V336A16,16,0,0,0,432,320ZM488,0h-128c-21.37,0-32.05,25.91-17,41l35.73,35.73L135,320.37a24,24,0,0,0,0,34L157.67,377a24,24,0,0,0,34,0L435.28,133.32,471,169c15,15,41,4.5,41-17V24A24,24,0,0,0,488,0Z&#34;&gt;&#xA;            &lt;/path&gt;&#xA;        &lt;/svg&gt;&#xA;    &lt;/span&gt;&#xA;        &#xA;    &#xA;&lt;/a&gt; extension. This adds a number of new email filter actions to Thunderbird. After installation, navigate to the &lt;code&gt;FiltaQuilla&lt;/code&gt; preferences and check the &lt;code&gt;Run Program&lt;/code&gt; filter action. Then restart Thunderbird.&lt;/p&gt;&#xA; &lt;h3 id=&#34;notification-display-script&#34;&gt;&#xA;  &lt;a href=&#34;#notification-display-script&#34; class=&#34;header-link&#34;&gt;&#xA;    Notification display script&#xA;  &lt;/a&gt;&#xA;&lt;/h3&gt;&lt;p&gt;Create the script that later runs when a certain filter rule fires. I created &lt;code&gt;~/scripts/thunderbird_alert.sh&lt;/code&gt; with the following content&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;cp&#34;&gt;#!/bin/bash&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;cp&#34;&gt;&lt;/span&gt;osascript -e &lt;span class=&#34;s1&#34;&gt;&amp;#39;display notification &amp;#34;A new spot opened up. Check your inbox.&amp;#34; with title &amp;#34;Mail from Triathlon Club&amp;#34; sound name &amp;#34;Glass&amp;#34;&amp;#39;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then add execution rights to the script with &lt;code&gt;chmod +x ~/scripts/thunderbird_alert.sh&lt;/code&gt;. I tested the notification by running the script: &lt;code&gt;~/scripts/thunderbird_alert.sh&lt;/code&gt;. You should see it appear in the top right corner of your screen. Mine looks like this:&#xA;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;div class=&#34;image-wrapper&#34;&gt;&#xA;  &lt;img src=&#34;triathlon_notification.jpg&#34; alt=&#34;Triathlon spot notification&#34; loading=&#34;lazy&#34; /&gt;&#xA;  &lt;figcaption&gt;Figure 1. Notification about new spots for Triathlon training sessions.&lt;/figcaption&gt;&#xA;  &lt;/div&gt;&#xA;&lt;/figure&gt;&#xA;&lt;/p&gt;&#xA; &lt;h3 id=&#34;set-up-filter-rule&#34;&gt;&#xA;  &lt;a href=&#34;#set-up-filter-rule&#34; class=&#34;header-link&#34;&gt;&#xA;    Set up filter rule&#xA;  &lt;/a&gt;&#xA;&lt;/h3&gt;&lt;p&gt;Back in Thunderbird, go to &lt;code&gt;Tools&lt;/code&gt; -&amp;gt; &lt;code&gt;Message Filters&lt;/code&gt; -&amp;gt; &lt;code&gt;New...&lt;/code&gt;. Give the new rule a name, then set match on &lt;code&gt;From&lt;/code&gt; &lt;code&gt;is&lt;/code&gt; &lt;code&gt;no_reply@triathlon.club&lt;/code&gt;. For the action select &lt;code&gt;Run Program&lt;/code&gt; and paste the path to the notification script &lt;code&gt;/Users/myname/scripts/thunderbird_alert.sh&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;That&amp;rsquo;s it. Every time a new email with that address arrives in Thunderbird, the filter rule fires the script and I see the alert that a spot is available. Compared to previous weeks my booking rate for popular sessions has gone up a lot.&lt;/p&gt;&#xA;</description>
    </item>
    
  </channel>
</rss>
