IFTTT on the MacBook Pro with Touch Bar

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.

Save big with VPN deals from ExpressVPN, PureVPN, Surfshark & more

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.

    Click on New Applet under your Profile, then click on This

  5. Search for Webhooks.
  6. Click on the Webhooks logo.
  7. Choose Receive a web request.

    Click on the service icon, then click on Receive a web request

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

    Enter an event name, then click on Create trigger

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

    Click on That, then select a service

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

    Click on an action, then select the action, then 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.

    Click on the Applet you just created, then click on the Webhooks icon

  4. Click on Settings in the upper right corner, just below your profile name.
  5. 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.

    Click on Settings, then copy the key code at the end of the URL

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.

    Click on Touch Bar, then click on add Touchbar button

  4. Click on Controlling Other Applications under Predefined Action
  5. Select Run Apple Script in background.

    Click on Controlling other Applications, then click on Run Apple Script in background

  6. 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}"

  7. Replace {event} with the event name you used to create the recipe.
  8. 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"

  9. Click on Save.
  10. Enter a Name for your button. This can be anything you like.
  11. Customize the button with an icon and color.

    Enter the code from the guide, replace the event and key with your info, click on Save, then name the button and select a customized 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.

MacBook Pro