How can I play a sound during a break in Time Out?

To play a sound or perform other actions before, during, or after a break, check out the Actions page of the break editor:

Actions page

Other actions include the ability to display a notification (with an optional sound), fade out the currently playing sound (useful at the end of the break), flash the screen, and speak some text with speech synthesis. Several scripts are provided, too.

To add an action, simply click the + button in the top-right corner of the window, to display a menu of available actions:

Add action menu

(When you first click this button, the scripts won’t be there, and there will just be “More…” item at the end; choose this to install the scripts.)

The first bunch are the various actions, followed by scripts, which are like customizable actions. At the end of the menu are items to open the Scripts folder in the Finder, so you can edit or add scripts, and go to the Time Out Extras page to download more scripts.

Once you add an action, you’ll see a header row with the name of the action and some other controls:

Action header

You can use the interval picker and pop-up menu to indicate when to use the action. The interval picker enables you to offset from the action stage by a number of seconds, minutes or even hours (click on the units to change them). Instead of just being able to play a sound at the start and/or end of a break, you can choose from many more times, including before due, after skipping, and more:

Action when menu

After those controls is a Preview (Preview) button, that will demonstrate the action. And a Remove (Remove) button to remove the action.

Here is a brief video to demo the feature: adding a Play Sound action to play a long music track, and a Fadeout Sound action to make it fade out when the break successfully finishes. (You might instead want to have it fade out for any end, otherwise it’d keep playing till done if you skip.)

This is a powerful and flexible feature of the app, especially when using custom scripts.

Why are my Simon tests timing out on my Apple Silicon Mac?

If you install Simon on an Apple Silicon (M1, M2, etc) based Mac, you may notice Web Page tests timing out.

That is because the Web Page service uses an embedded helper tool to load the HTML in a separate process, to improve performance and reduce the risk of crashing Simon. But currently this helper is Intel-only. Some other helpers, e.g. to send emails or upload reports to a remote server, are also Intel-only.

This is fine, but it means that you need to install Rosetta, Apple’s emulation layer to enable running Intel apps on Apple Silicon.

The main Simon app is universal, so launching it won’t prompt to install Rosetta, but you can override that by checking the “Open using Rosetta” option in the Finder’s Get Info window:

Open using Rosetta

Just remember to uncheck that option after you’ve opened Simon, so subsequent launches use the universal code.

Using Simon to watch YouTube subscriber counts

A customer sent a query, asking how to use Simon to monitor the subscriber counts on YouTube channels.

This is easy for Simon to do, by having Web Page tests for each YouTube channel, each with a filter to extract the subscriber count, and whatever notifier you wish.

The first step is to add a Web Page test for a YouTube channel, and look at the HTML output in the Preview pane, to find how the subscriber count appears.

Test

For example, for my Sinclair Trails channel, the HTML includes:

    "subscriberCountText":{"accessibility":{"accessibilityData":{"label":"30 subscribers"}},"simpleText":"30 subscribers”},

Yes, I currently only have 30 subscribers… rather sad. Please subscribe to help me reach a more respectable number!

A sensible default choice for a filter is the Block one, though in this case a better choice would be the Find Regular Expression filter. But if you want to have several tests with the same notifier configuration, an even better choice is to create a new custom notifier, so you don’t have to configure the notifier for each test.

A regular expression to extract the subscriber count from that HTML could be:

    subscriberCountText.+?simpleText\":\"(.+?)\”\}

This will look for text starting with “subscriberCountText”, some more text, then “simpleText”:"” , then capture the desired text up until “”\}” .

In my case, that will result in:

    30 subscribers

To make a new filter for this, you can go to the Filters page in Simon, and add a new filter named “YouTube subscribers” (or whatever you prefer).

Then choose Find for the Filter Kind, and Regular Expression from the find options menu:

Find options

Then enter the expression as the find text, and choose Capture 1 as the output:

Custom filter

Click Done, then go back to your YouTube test, and choose this new filter on the Filters page:

Test filters

This will output just the subscriber count:

Filter output

You can see this output in the Activity log:

Activity log

Or you can add a new Email notifier to email the filter output using the {FilterOutputText} variable:

Email notifier

And of course use that notifier in your test, along with whatever other notifiers you wish:

Test notifiers

Then you can add more tests for other YouTube channels you want to monitor, specifying your YouTube subscribers filter for each. For example, CGP Grey has a few more subscribers than me:

CGP Grey test

I hope this helps!

Why haven’t I received an email from Dejal?

If you send an email to Dejal asking for support, you should expect a reply within 24 hours. If you don’t get one, chances are your email service has mis-flagged it as spam. So check your spam folder.

If you use the contact form, and request a reply, you will get an automated reply email from the Dejal server within minutes, acknowledging receipt. And will get a personal reply within 24 hours, if needed. So if you don’t get that automatic reply, again check your spam folder.

I know it’s frustrating to write to a company and not get a reply. As an indie developer, I strive to provide excellent customer support. But it’s just as frustrating for me when I write a lengthy reply and it bounces due to a mail server being full, or thinking its spam, or other issues. So please check that you don’t have overly aggressive spam filtering if you’d like to receive a reply.

Another alternative to email, if you want to bypass those possible hassles, is to post in the Dejal community on Reddit, r/Dejal. I check that every day (well, most of the time), plus other members may be able to help you too.

And of course check the Frequently Asked Questions list, in case your issue is a commonly asked one.

Simon tip: watching the Yellowstone gate cam

Here’s a fun example of using Simon for a purpose that may not be entirely obvious.

My wife and I had a big trip to Yellowstone National Park coming up, so I was curious about what the traffic was like to get into the park.

Conveniently, Yellowstone has a number of webcams that watch the park, including the west entrance gate, where we’d be entering.

So I thought I could leverage Simon to help me watch it over time — rather than keeping the web page open and watching it throughout the day, I can have Simon capture the webcam images to a local folder, then review at my convenience.

To find the URL of the webcam image, I used Safari’s web inspector:

Inspector

Then I added a custom service to Simon to download the webcam images to a folder:

Simon service script

That uses the curl command line tool to download the image and save to a local folder; the `date -v+1H +%Y%m%d%H%M%S` part of the path outputs the date and time in the format YYMMDDHHMMSS, adding one hour from my local time zone, since Yellowstone was an hour ahead of me at the time.

To schedule the captures, I added a test in Simon that checks once per minute, using that service. No filters or notifiers needed.

That results in a folder in the Finder with files like this:

Finder

I can arrow through them to quickly view them. And I can also do other things, like use the excellent Retrobatch app to convert them to a GIF:

Retrobatch

Click to view an example of the resulting GIF, showing the traffic flow from 06:00 to 18:00 on one day (the GIF is 61 MB, despite being scaled, so might take a moment to load); each frame of the GIF represents one minute, six frames per second:

That seems typical; it gets really busy around 06:30, and eases off around 12:30 every day. So a tip for Yellowstone visitors; enter in the afternoon! Of course, that really only works if you’re staying in the park, since it takes ages to get anywhere in the park. It’s a big place.

If you’re curious, I did several posts about this Yellowstone trip on my Sinclair Trails blog. Check it out!

Simon script example: Show & Screenshot

One of the major strengths of Simon, my website and server monitoring tool, is the flexibility it offers through the ability to write custom scripts in many scripting languages. Simon is plenty useful with the built-in services, filters, and notifiers, but the ability for customers to enhance it themselves makes it even better.

There are several script-based services, filters, and notifiers built in to the app, and others can be downloaded from the Simon Extras page.

One such example is the Show & Screenshot notifier script (click that link to download it). To install it, go to the Notifiers page in Simon, add a new notifier, choose Script for the notifier kind, click the Open Script… button, and choose the downloaded script.

This script simply opens the page in the default web browser, waits a few seconds for the page to render, then takes a screenshot of it. By default it’ll wait 10 seconds, and save to the Desktop, but you can customize those values; enter the path of a folder to save them to (the folder must already exist). Also specify how long to wait before performing the screenshot, in seconds:

Browser screenshot

And of course to use the notifier, specify it in the Notifiers page of a test:

Use notifier

Note that when this notifier is first used, macOS will ask for permission to capture the screen; until you grant that, it’ll capture an empty desktop.

Check out the Simon Extras page for other scripts. And if you create a useful script for Simon, please share it with others!

Simon’s preview pane

As you know, Simon is a website and server monitoring tool. This mouthful is to try to describe two of the levels at which Simon operates. At the very basic level, Simon is a very simple utility to watch web pages, and let you know when they change or go down. But Simon has much more depth to it — it enables you to monitor all sorts of internet servers and services, local applications, disk volumes, and more.

The Preview pane has this duality, too. When used with a web-based test (i.e. one using the Web Page service), it displays the rendered web page and graphics on the left (which can be interacted with like in a web browser), and the HTML source, web page headers, and filter output on the right:

Web preview

This is really handy, both to quickly see the page while in Simon, without having to switch to a web browser (which is easy too, via the File ▸ Visit Site command), and when setting up the test in the first place.

The service and filter output are useful, too; you can see the HTML (or other) output, and the output of each filter.

The filters are one of Simon’s key features. This is a page of the test editor, where you can tell Simon to only look at the HTML source between two blocks of text, or find required text, or evaluate numbers, or reformat text, and much more. This enables you to focus on the part of the page you care about, and avoid dynamic portions like banner ads etc. You can easily set this up via the Preview window. With the test editor open, after entering the URL, show the Preview to display the preview of the page. Then search through the HTML source for interesting portions of the text (click in the HTML then press ⌘F to find text), select it, copy the relevant text, and paste into filter fields.

For example, here’s Apple’s RSS feed, with filters to extract and format the title and body text of the latest news:

RSS prevoew

As useful as this is, it’s not done yet. The Preview is also supported by many other services, in a slightly different way. For non-web services, the Preview looks much the same, but without the rendered content. Instead of the HTML source, it shows the output of the service. This is all plain text, since that’s what these services deal with.

For example, here’s the preview of a Ping test:

Ping preview

These services support the filters, too: just like with web pages, you can use filters to analyze the output and extract interesting nuggets.

I hope you’ll use the Preview to good advantage when configuring and using Simon.

Simon’s automatic offline support

A useful feature of Simon is how it handles the situation when your computer loses its internet connection.

People sometimes ask me what Simon does in this situation, concerned that it would count as a failure for tests. Simon is smarter than that, though. Every time it starts a check, it first checks if the computer has a current internet connection, and only then performs the check.

If it determines that your internet connection has been disrupted, it places the test in an “offline” state, where it shows a blinking “lightning bolt” for the status icon until the connection is restored. This offline state doesn’t count as a failure (or success).

Simon works out if you have a connection by seeing if it can resolve one of two popular domain names; if either work, your connection is probably fine, but if both fail, it is likely disconnected. Using two domains avoids a temporary outage of either one.

You can disable this internet connection check on a per-test basis via the Can check when offline checkbox on the test editor’s Options page. This is useful if you want to create a test to notify you when your connection goes down, or for tests that don’t require an internet connection (e.g. using the Application or Script service kinds):

Offline option

Can Simon notify via email?

I sometimes receive a question from a potential customer, asking whether Simon has the ability to send a notification via email.

Although I do mention it in a number of places, this isn’t an unreasonable question, particularly if you just download Simon and start playing with it, as no email options appear in the list of available notifiers in the Edit Test pane by default.

Why is this? Because unlike the Speech and Sound kinds of notifiers, the Email one requires some configuration before it can be used, so it can’t be offered by default.

The way notifiers work is (I hope) pretty intuitive, but a little indirect. Simon provides a number of notifier kinds that do the work of notifications, and you configure notifiers to use those, then choose notifiers for each test.

These levels of abstraction allow easy re-use of notifiers: a single kind of notifier can be used by multiple notifiers, and a single notifier can be used by multiple tests, without having to set up the same things over and over again.

For example, you can add a notifier to email yourself for some failures, another email notifier to your clients for other failures, another one for recoveries, and so on, and use whichever ones of those are desired in tens or hundreds of tests, as required, as simply as choosing them from a pop-up menu.

So, as I said, there is no email notifier set up by default, since it needs configuration, but you can easily add one. If you’re editing a test and realize that you want to receive an email when this test changes, fails, and/or recovers, you can click the New Notifier… button in the Notifiers section of the Edit Test pane, which will switch to the Notifiers page, and start editing a new notifier. You can then choose Email from the Notifier Kind pop-up menu, and the controls below will change to those for an email, with a sample email pre-populated, which you can edit as desired:

New notifier

You can then configure the email To etc fields, plus switch to the Name page to give the notifier a name, and perhaps the Options page to indicate whether this notifier is available for changes, failures and/or recoveries.

Once it all looks good, click Done to save the notifier. You can check that it is set up correctly by choosing the File ▸ Notify Now menu command; that will send an email with placeholder values. If you don’t receive the email, check the notifier settings.

The new notifier will then be available for that test and any others you want to use it in:

Test notifiers

Easy!