Room Change Alerts

CurrentKey can notify your own custom AppleScript every time you switch between Rooms, and tell your script which Room has been moved into.

A simple AppleScript that will do something custom upon entering a specific Room (Space) or activating an app.

What could I do with this power?

Just brainstorming off the top of my head, here are some ideas for theme-based Room customization, as well as scripts or individual actions that could make sense to trigger (upon entering/leaving Rooms).

You can also pair Room alerts with CurrentKey’s support for 14 AppleScript commands for even more nuanced outcomes.

Ideas for unique Room themes:

  • Have a “language learning” Room, and assign custom internet radio stations for them with Broadcasts, so it would start playing a Spanish station when you go into your Spanish Room! 🗣️
  • Have a “Weather” Space and refresh several weather radar maps in Safari, Chrome, or Brave, immediately upon entering. ☀️
  • Give each of your Spaces a picture-in-picture video intro with Helium 3. 🎬 ➡️ 🎥
  • Have a “distraction free” space that mutes volume, activates dark mode, hides dock, and turns off WiFi. 🤫 It could return settings to normal when leaving.
  • Have a “Communication HQ” Room that will automatically sync your Mail app to check for latest email upon entering… and sync your Evernote notebooks too. 📬 🔄
  • Assign each room in your house to a different Room in CurrentKey, so that when you walk into your kitchen, you’re taken to the Space with your recipes, kitchen timers, and more! This is possible with EventScripts and iBeacons. 🏠

A list of specific actions you could selectively combine to create really cool scripts:

  • Refresh a specific webpage in Chrome, Safari, etc (they all support automation)
  • Pause/resume a screen sharing application
  • Create a smart Pomodoro timer that stops and starts when you’re in specific apps (or Spaces). This one already has AppleScript support 🍅 ⏱
  • Bring a specific app to the front
  • Activate smart home things, like LED lights, sound systems, etc
  • Hook it up to IFTTT to run a Room-specific workflow
  • Refresh Mail’s Inbox for new messages with its “check for new mail” command
  • Have the name of the current Room (Space) be read aloud
  • Take a screenshot
  • Run a local Python script
  • Start/pause an Amphetamine session, which actually has terrific AppleScript support.
  • Start a presentation
  • Play a specific set of Spotify tracks
  • Crank up or mute your Mac’s volume
  • Pause/unpause your media player
  • Automatically tell a Slack channel you’ve left or entered a Room.
  • Add a note, maybe with additional context via CurrentKey’s stat-fetching commands, in a powerful program like Agenda, which puts such notes on a timeline.
  • Start a Photos slideshow.
  • You can use CurrentKey’s stats-fetching commands, to add more nuance, like only activating certain scripts if certain time-spent threshold had/hadn’t been met. You can even tell a CurrentKey to go to a certain Room programmatically. So you could move between your Spaces with a remote control (or a phone) 🕹️!
  • Have an app you’d like me to build into a Rooms workflow? Let me know on Twitter!

How is this enabled and set up?

First, head to the new Background Services panel, found via Preferences. Next, click the Open button that is next to the “It will look for a user-provided “ck.scpt” in this folder:” label. This will open your Finder to the directory that you will place your custom AppleScript.

In the example above, the AppleScript will get called with a “roomName” parameter. It checks to see if the Room’s name is “coding”, and if it is, it brings Xcode to the front through AppleScript’s “activate” command. If you move into a fullscreen app, the parameter will read “_fullscreen_”.

This concept is simple and powerful, enabling you to trigger Room-specific functionality outside of the app. Let your imagination run wild with all the possibilities: turn on cool LED lights when you enter your gaming Room? You can write a script for that! Bring your favorite programming app to the foreground when you enter your coding Room? Write a script for that! Pause a timer when you leave a specific Room? It can be done! The possibilities are infinite!

There’s a tutorial that includes a video here.