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:
- An IFTTT account: If you don't already have one, visit the website and sign up.
- The Webhooks service: Once you have an IFTTT account, connect the Webhooks service by hitting the Connect button on its Maker page.
- 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.
Master your iPhone in minutes
iMore offers spot-on advice and guidance from our team of experts, with decades of Apple device experience to lean on. Learn more with iMore!
- Log into your IFTTT account.
- Click on your Profile in the upper right corner of the website.
- Select New Applet.
- Click on This in the recipe creator. It is highlighted in blue and has a plus symbol in front of it.
- Search for Webhooks.
- Click on the Webhooks logo.
- Choose Receive a web request.
- Enter an Event name. This should be lowercase and without any spaces. Make sure to remember this event name for later.
- Click on Create trigger.
- Click on That in the recipe creator. It is highlighted in blue and has a plus symbol in front of it.
- Search for the service you want to use (Philips Hue, for example).
- Click on the service logo.
- Select an action. In my case, I selected Set a scene in a room.
- Choose what action will take place. In my case, I chose to set the lights in a specific room to turn a specific color.
- Click on Create action.
- 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.
- Click on My Applets on IFTTT.
- Click on the Applet you just created.
- Click on the Webhooks icon.
- Click on Settings in the upper right corner, just below your profile name.
- 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.
- Launch BetterTouchTool on your MacBook Pro with Touch Bar.
- Click on the TouchBar tab.
- Click on + TouchBar Button.
- Click on Controlling Other Applications under Predefined Action
- Select Run Apple Script in background.
- 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}"
- Replace {event} with the event name you used to create the recipe.
- 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"
- Click on Save.
- Enter a Name for your button. This can be anything you like.
- 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 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).