Focus is a Mac app that blocks distracting websites like Facebook and Reddit. Download Now

How to start Focus in X minutes

Scripting not only allows you to run custom actions when Focus turns on and off (like logging your time), but allows you to control Focus from other applications.

This is a very powerful way to extend Focus for your needs—allowing you, for example, to turn Focus on after 5 minutes have passed.

Let’s learn how to accomplish this with Focus scripting.

Creating an Applescript that turns Focus on in 5 minutes

Applescript is a system wide way to script applications on Mac OS X, and is perfectly suited for this task.

Open Applications > Utilities > Script Editor and type the following:

delay 300
do shell script "open focus://focus?minutes=30"

Script Editor Interface with Focus code

Note, you can also download the ready-made script if you’d prefer.

That’s it!

Pay special attention to the delay 300 and minutes=30.

These lines say wait for 300 seconds (5 minutes) and then turn Focus on for 30 minutes. You can change these to suit your needs.

If you hit Command+R or press the play button in Script Editor, it will execute your script by waiting for the amount of time specified—then starting Focus for the other duration specified.

Making it more convenient to use

This is great, but you don’t really want to go through Script Editor every time you want to run the script.

Luckily there’s an easy way to get these in your menubar so you can access them a lot faster.

Go to Script Editor > Preferences > General > Script Menu and make sure “Show script menu in menubar” is checked.

Script Editor Preferences Panel

Now you’ll have a new icon in your menubar. When you click it, it will list the available scripts to run on your computer.

Click the menubar icon and go to Open Scripts Folder > Open User Scripts Folder.

This will reveal the directory where user scripts need to go to show up in the menubar.

Go back to Script Editor and save the file (or move it if you used the download) to the directory above.

Now when you click the Script Editor menubar icon, you’ll see the script listed.

Script Editor Menu Dropdown

To start the script, just click the menu item. You should see another item appear in your menubar letting you know the script is running successfully, and after 5 minutes (or whatever you specified) Focus will start.

That’s it! Focus scripting is extremely powerful and can accomplish a lot. If you have something specific you’d like to do, email us at support@heyfocus.com and we’d love to see how we can help!


Download Focus and steal back your productivity. Get more work done, stay in the flow and create your perfect work environment with 1-click.

Stay up to date with the latest Focus updates and news