How to use IFTTT with the Touch Bar on the MacBook Pro

IT blog Duck's Tech Blog recently published a guide for controlling IFTTT recipes from your Touch Bar. It uses BetterTouchTool, the super awesome third-party Touch Bar app that makes it possible to add any app to your Touch Bar. Using IFTTT and BetterTouchTool, you can enable triggers right from your Touch Bar.

IFTTT is a program that connects different services, so you can create Applets to automatically trigger an event to those services based on a specific condition. IFTTT stands for If This Then That. Recipes are based on the condition (If This) which triggers an action (Then That).

BetterTouchTool is a program for MacBook Pro with Touch Bar that lets you select any app on your computer to use with your Touch Bar. It's almost like an IFTTT service. If you touch a specific button in the Touch Bar, it will trigger a specific action, like sending a shortcut to an app or running an Apple Script.

Together, these two programs make it possible for you to create a button for an IFTTT recipe that you can access from the Touch Bar on your MacBook Pro.

In this guide, we're going to specifically create a recipe for running a smart bulb action. I'm using Hue lights, but duklabs used Yeelights. You can select from a huge variety of home-connected devices though, including GE appliances, Whirlpool appliances, WeMo devices, LIFX bulbs, Lightwave RF bulbs, and a lot more. Browse through IFTTT's available services to find out more.

What you'll need

In order to execute this action, you'll need to be signed up for and install a few programs. You'll need the following:

  1. An IFTTT account: If you don't already have one, visit the website and sign up.
  2. The Webhooks service: Once you have an IFTTT account, connect the Webhooks service by hitting the Connect button on its Maker page.
  3. BetterTouchTool on your MacBook Pro with Touch bar: It isn't available in the App Store and you'll have to give it permission to control some of your computer's hardware, but it is from a legitimate developer and won't harm your Mac. If you don't already have it, you can download it directly from the developer.

Create the recipe

Once you've got all the accounts, services, and apps you need for this action, you can create the recipe.

  1. Log into your IFTTT account.
  2. Click on your Profile in the upper right corner of the website.
  3. Select New Applet.
  4. Click on This in the recipe creator. It is highlighted in blue and has a plus symbol in front of it.

  1. Search for Webhooks.
  2. Click on the Webhooks logo.
  3. Choose Receive a web request.

  1. Enter an Event name. This should be lowercase and without any spaces. Make sure to remember this event name for later.
  2. Click on Create trigger.

  1. Click on That in the recipe creator. It is highlighted in blue and has a plus symbol in front of it.
  2. Search for the service you want to use (Philips Hue, for example).
  3. Click on the service logo.

  1. Select an action. In my case, I selected Set a scene in a room.
  2. Choose what action will take place. In my case, I chose to set the lights in a specific room to turn a specific color.
  3. Click on Create action.
  4. Click on Finish.

Find your Webhooks key

You'll need the specific key you just made in order to use it to create a Touch Bar button with BetterTouchTool. Each Webhooks Applet has a specific key.

  1. Click on My Applets on IFTTT.
  2. Click on the Applet you just created.
  3. Click on the Webhooks icon.

  1. Click on Settings in the upper right corner, just below your profile name.
  2. Copy the key at the end of the URL listed. You can paste it into a Stickie or just keep the web page open while you follow the next set of instructions.

Create the Touch Bar button

The next step is to create the shortcut button on your MacBook Pro with Touch Bar using BetterTouchTool.

  1. Launch BetterTouchTool on your MacBook Pro with Touch Bar.
  2. Click on the TouchBar tab.
  3. Click on + TouchBar Button.

  1. Click on Controlling Other Applications under Predefined Action
  2. Select Run Apple Script in background.

  1. Enter the following text into the next window (thanks to Duck Tech for this code):return do shell script "curl -X POST https://maker.ifttt.com/trigger/{event}/with/key/{yourKey}"
  2. Replace {event} with the event name you used to create the recipe.
  3. Replace {yourKey} with the key you got from the Webhooks URL.Mine looks like this:return do shell script "curl -X POST https://maker.ifttt.com/trigger/game_of_thrones/with/key/cGBkxpLR4l6KfXdbfg1SSp"
  4. Click on Save.
  5. Enter a Name for your button. This can be anything you like.
  6. Customize the button with an icon and color.

When you've finished the steps above, the button will appear automatically in your Touch Bar. Tap it to trigger the action. It may take a couple of seconds to run.

Do you have any recipes?

I've only experimented with one Webhooks recipe so far, but there are dozens I can try. Do you have any recipes that work with IFTTT and BetterTouchTool? Let us know in the comments. I'd love to try them out.

Lory Gil

Lory is a renaissance woman, writing news, reviews, and how-to guides for iMore. She also fancies herself a bit of a rock star in her town and spends too much time reading comic books.  If she's not typing away at her keyboard, you can probably find her at Disneyland or watching Star Wars (or both).