How can Time Out pause any media before a break?

Time Out can perform actions before, during, or after a break. What if you want it to pause any media playing before a break?

A customer contributed a script that can be used with Break Actions to do just that.

It pauses any playing media when a break starts — Spotify, Plexamp, BBC Sounds, browser-based players, or anything else registered with macOS’s Now Playing system. Apps that are already paused are unaffected.

In addition to the script that you can use with Time Out’s Break Actions, there is a brew dependency that requires installation.

See the Pause Media GitHub page for details.

Note that I haven’t tested this; it seems fine, but use at your own risk.

How can I detect when the camera is in use for Time Out?

Time Out includes the ability to detect when Zoom, Teams, or FaceTime is actively in a meeting, and postpone or skip breaks via the Rules feature. But if you have something else using the camera, is there a way to detect that?

A customer contributed a script that can be used with Rules to do just that.

It automatically skips or postpones Time Out breaks while your camera is active, so you are never interrupted mid-video call. More general than the built-in rules for specific apps.

In addition to the script that you can use with Time Out’s Rules, there is an app dependency, which is bundled with the script.

See the Camera In Use GitHub page for details.

Note that I haven’t tested this; it seems fine, but use at your own risk.

How can I look for changes in a large binary file on a site?

If you want to use Simon to detect when a large binary file like an app changes, one option would be to use a Web Page test with the download URL. But that would end up storing the entire download in the test, slowing it down and possibly causing loading or saving failures, as that large amount of data is encoded in JSON.

A better option is to just get a checksum of the file. That would only need to store a small amount of data, and would still result in a change when combined with a filter like Any Change.

Here’s a custom script-based service to assist with this; you can download it from the Simon Extras page:

Checksum script

Here’s a direct download of the script.

As always, you can add this a a new service in Simon via these easy steps:

  1. Download and decompress the downloaded archive, if your browser didn’t do it for you.
  2. Go to the Services list in Simon.
  3. Click the New toolbar button (or via the File menu).
  4. On the Name page, give the new service a suitable name, like “Checksum”.
  5. Choose the Service Kind button to show the service page.
  6. Choose the Script service kind, if not selected by default.
  7. Click the Open Script… button and choose the script file.
  8. Click Done to finish editing the new service.

You can then add a new test and choose this new service, entering a URL to check, and using the default Any Changes filter.

Enjoy!

The Calm theme can’t log in; how can I still use Calm?

Time Out has long had a theme that displayed the Calm.com website, where members of that service can do Calm session on a schedule managed by Time Out.

Unfortunately, they recently seem to have changed their website in such a way that can prevent logging in via email when displayed by Time Out.

As a workaround, I created a simple AppleScript break action to open Calm in Safari:

tell application "Safari"
activate
open location "https://www.calm.com/"
end tell

You can download this script from the Time Out Extras page: here’s a direct download link. Then add it to Time Out by using the Reveal Scripts command in the + menu on the Break Actions page.

(If you prefer a different browser, you can edit the script accordingly.)

To use it, set the Break Theme to None:

Theme is None

And add the Open Calm in Safari script to the Break Actions page:

Action is Calm

That way you’ll get the usual Time Out break control panel and progress bar over the Calm session in the Safari browser. Once the break is done, you can simply close that page in Safari.

How can I mute the Mac sound before a break, then restore the volume afterwards?

A customer said that they play music via YouTube, and wanted to silence it during their breaks. Time Out is very flexible, so I was able to come up with a solution for them, using Automator workflows as Break Actions.

I created three workflows, that you can download from the Script Actions section of the Time Out Extras page. Here are direct download links for your convenience:

You can of course edit these in Apple’s Automator app to choose different volume levels.

To install them, choose Reveal Scripts from the + menu on the Break Actions page in Time Out:

Reveal Scripts

Then decompress those actions and add to the revealed folder in the Finder. They will then appear in that menu so you can use them with a break.

Here’s a fancy example, where Time Out will flash the screen 10 seconds before a break is due, play a bell sound 5 seconds before the break is due, mute the volume once the break fades in, set the sound volume back to 25% level once the break ends (whether done, postponed, or skipped), and finally play a different bell sound 1 second after it is done (but won’t play if postponed or skipped):

Volume actions

I hope you find this helpful.

Follow Dejal on Mastodon, Bluesky, Threads, Micro.blog, Facebook, Reddit, and more

Dejal is now on the Mastodon and Bluesky social networks, joining Micro.blog, Threads, Facebook, Reddit, and of course the blog and its RSS feed.

On Mastodon, follow @dejal@mastodon.social.

On Bluesky, follow @dejal.com.

On Micro.blog, follow @dejal.

On Threads, follow @dejal.

On Facebook, follow @dejalcom.

On Reddit, follow /r/dejal.

The Dejal blog is on the Dejal website.

In a RSS reader (like the excellent NewsBlur, that Dejal works on), follow dejal.com/blog/feed.

Technically Dejal is also on X (formerly Twitter), but that is not used anymore.

New posts appear first on the Dejal blog and RSS feed, then on Micro.blog, which cross-posts them to Mastodon, Bluesky, and Threads.

Dejal logo

Can I have Time Out remind me when to go home at the end of day?

I received a customer query asking if it was possible to have a countdown in the menubar for remaining time in the work day.

They wanted a “Go Home” reminder, that was used daily except weekends, and started work at 7 AM and finished at 3 PM.

Time Out is very flexible, so I was able to configure this for them. Here’s a screenshot of the Break Schedule page:

Time Out schedule page

An explanation of the options:

  1. Break for 1 minute, just as a token reminder of the end of day; it could be any length, or even zero to use a Break Action like a notification instead of dimming the screen.
  2. Every 1 day, to have a daily repetition.
  3. From Fixed Time 0 minutes past the hour, to align the due time to the hour (not essential, since it is ignoring idle time, but tidier).
  4. Available Between 15:00 and 07:00 on MTWTF, these are the most important options, to have the break start at 15:00 (3 PM) and end at 07:00 (7 AM) — yes, it’s totally fine to have the end time earlier than the start time. And to only use this on weekdays.
  5. As you can see, the next due time is at 15:00 (3 PM).
  6. When taking a natural break… Continue Countdown, to ignore idle time.
  7. The reset and skip options are off, to avoid adjusting the due time.
  8. When this break is due Start Immediately, this could be any option; asking to start might be useful if you need a few minutes to finish off what you’re doing.

And of course to have the countdown in the menubar, you’d include that option on the General page, possibly including the Only include long breaks option to not show any micro-breaks during the day:

General options

I hope this helps others who want something similar!

How can I send an email or text message when a break is due or done?

I recently had an interesting customer request. They wanted to send an email or text message when a break was due, in case they were away from their Mac.

So I added a couple of new scripts to the Time Out Extras page.

The first one is called Send Email, which as you might imagine, sends an email message. Download it here.

Here’s the script; after downloading it, you’ll need to edit it to replace the two instances of example@example.com with your email address; you can customize the subject and content of the message as desired:

tell application "Mail"
	set my_message to make new outgoing message
	set subject of my_message to "Time Out break"
	set content of my_message to "Time for a break...."
	set sender of my_message to "example@example.com"
	--
	tell my_message
		make new to recipient at end of to recipients with properties {name:"example@example.com"}
	end tell
	--
	send my_message
end tell

The second script is called Send Message, which you may be amazed to learn sends a text message (via iMessage, Apple’s “blue bubble” messaging protocol). Download it here.

Here’s the script; after downloading it, you’ll need to edit it to replace the example@example.com with your iCloud email address or phone number; you can customize the message as desired:

tell application "Messages"
	set targetBuddy to "example@example.com"
	set targetService to id of 1st account whose service type = iMessage
	set textMessage to "Time for a break!"
	set theBuddy to participant targetBuddy of account id targetService
	send textMessage to theBuddy
end tell

To install the scripts, open the Time Out settings window, select a break, and go to the Break Actions page, then click the + button and choose the Reveal Scripts menu command:

Break Actions menu

Then drag the script files into that revealed folder. Then they will appear in that menu so you can choose one of them.

As always, you can choose to use these scripts before the break is due, when it starts, or when it is done, amongst other options. If you have a long break that you spend away from your Mac, a message when it is done could be very useful:

Send Email after done

If you want to send a message when a break is due, note that if you’re away from your Mac, by default the breaks are skipped, so it won’t send the messages. You can avoid that by choosing to Continue Countdown on the Break Schedule page:

Contine Countdown schedule option

As previously mentioned, I plan to write an iOS edition of Time Out, probably later this year. Once that’s done, you’ll be able to get notified of breaks on your iPhone, even when away from your Mac. But these scripts may be useful in the meantime. Enjoy!

How can I control Time Out from another app?

Time Out supports URL schemes to control some functions:

  • timeout://break/micro/start will start the Micro break.
  • timeout://break/micro/postpone1 to postpone the Micro break by the first postpone amount.
  • timeout://break/normal/postpone2 to postpone the Normal break by the second postpone amount.
  • timeout://break/mybreak/skip to skip “My Break”; use lowercase and omit spaces and punctuation for the break name in the URL.
  • timeout://break/micro/reset to reset the Micro break.
  • timeout://break/micro/pause/1h will pause only the Micro break for one hour.
  • timeout://break/micro/resume to resume only the Micro break.
  • timeout://pause will pause breaks indefinitely.
  • timeout://pause/10m will pause breaks for 10 minutes (use “s”, “m”, “h”, or “d” units, or no suffix for minutes).
  • timeout://resume to resume after a pause.
  • timeout://settings or timeout://preferences to show the Settings window.
  • timeout://settings/advanced/console to open the Console app.
  • timeout://settings/advanced/terminal to open the Terminal app.

Let me know if you want any other functions to be available via URL.