Session
Learn
Pricing
Support

Setup session automation on Mac with AppleScript

Philip Young

29 January 2021

Session automation on Mac is powered by AppleScript. This means you need to understand a bit of code to unlock it's full potential. If you don't know about Session automation yet, you can learn more from Automate your workflow with Session Automation.

If you don't want to dabble with code and just want to turn on Do Not Disturb on and off—follow this guide to turn on/off Do Not Disturb with Session.

If you're up with the challenge, you can learn to write your first AppleScript.

Now, let's dissect how to integrate AppleScript you wrote or download with Session.

1. Automation file name

There's 5 scenarios where automation ran. They are:

  1. Your session has started:session_start.scpt
  2. Your session has ended:session_end.scpt
  3. Your break has started:break_start.scpt
  4. Your break has ended:break_end.scpt
  5. You went to home screen ("What's your focus screen"):stop_working.scpt

p.s. .scpt is a file extension for AppleScript (like .mp3 for Music).

What you probably use is session_start, stop_working, and possibly break_start.

Session will run AppleScript you've made if the script with matching file name above exists on Session script folder. Otherwise, it'll be ignored.

2. Put the script you've wrote inside Session folder

You can put the script you've wrote, rename the script while filename above (refer to #1) inside Session's user script folder (you can open the folder location by clicking a button on Session's setting page).

Open AppleScript folder button

Move the script you have wrote / download to com.philipyoungg.session folder below:

AppleScript inside folder

3. Check if the AppleScript is working

  1. Go back to Session Preferences > Automation (AppleScript),
  2. check Session start checkbox,
  3. check Stop working checkbox,
  4. press Test session Start,
  5. make sure it turn on Do Not Disturb.
  6. Press Test stop Working,
  7. make sure it turn off Do Not Disturb.

If it didn't ran, make sure you have put the script in correct location. Refer to screenshot above. Otherwise, you can contact me on my email

4. Enjoy your automation!

Congratulations! Now you've automated your workflow based on Session current state!

Session
Changelog
Privacy
Terms
Support