Setup session automation on iOS and MacOS with Apple Shortcuts

Philip Young

In this guide, you'll learn how to integrate Session with Apple Shortcut. If you don't know about Session automation yet, you can learn more from Automate your workflow with Session Automation.

You can learn how to make your iOS Shortcut from internet / YouTube. We'll write a guide soon.

1. Apple Shortcuts naming

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

  1. Your session has started: session_start
  2. You paused session: session_pause
  3. You unpaused session: session_unpause
  4. Your session has ended: session_end
  5. Your session has finished but it went too long: `session_went_too_long
  6. Your break has started: break_start
  7. Your break has finished but it went too long: break_went_too_long
  8. Your break has ended: break_end
  9. Called whenever session_end or break_end not called. Example, from abandon Session : stop_working

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

Simply made an Apple Shortcut with the matching name above. Session will run it for you.

Setting Apple Shortcuts

2. Enable Shortcuts you've made

  1. Go to Session > Settings (Gear icon) > Automation,
  2. check all shortcuts you want to run,
  3. make sure you have matching file name on your Apple shortcuts.
  4. Note that if you check it and have no Shortcut with matching file name, Session won't do anything.

Enable Session Start Shortcut

3. Create the Shortcut

  1. Go to Apple Shortcuts app.
  2. Press + button to create a new shortcut.
  3. Set the Shortcut title to Shortcut you want.
  4. In this example, it's session_start.

Set Shortcut title to Session Start

4. Shortcut input data

As of Session v2.3, you will receive additional data from Session on shortcut like Session title, start date, end date, category title, etc

You can get those data on shortcut by choosing Get dictionary from input and choose the input as Shortcut input.

Then You can parse the data from Shortcut Input by getting it from Get Value For Key.

Shortcut Dictionary

Here are possible values from Session:

  • title: your session intention
  • type: fullFocus, partialFocus, pause, rest, or endEarly
  • category
    • id: Category ID
    • title: Category title
    • status: active | archived
    • hex_color: Color of the category
  • start_date: start date
  • pause_date: pause date if exists
  • end_date: ended date (only on session_end and break_end)
  • notes: the notes
  • meta: pauses with start date and end date if exists
  • duration_second: session duration you choose
  • passed_second: total passes second since start date
  • from_another_device: If the event comes from your other devices via real time sync

Shortcut Input Data

Use this Shortcut to easily get the data that you need.

"{}"
Session Shortcut JSON Parser

5. Additional Shortcuts

As of v2.10, Session has redesigned Apple Shortcuts to be more powerful and convenient. Now you can easily get Sessions':

  • title,
  • notes,
  • start date, and
  • category

…directly from Apple Shortcuts.

Keep in mind that this only works for ongoing session—not for session end or stop working.

For that you need to rely on Shortcut Input data.

Apple Shortcuts Helper

5. Enjoy your automation!

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

© Copyright 2020-2024 Translucent LLC