Change focus mode to Work with applescript

Is here someone, who could provide me a simple script? My goal is to turn on the Work focus mode with applescript, or with applescript through siri shortcuts.

(the main thing is, i need the script code definetly)

Replies

I don’t have time to prototype this today but:

  1. I believe you can change the Focus state using a shortcut.

  2. You can run shortcuts from the command line using the shortcuts tool.

  3. You can run command-line tools from AppleScript using do shell script.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

  • Thank you for taking time to reply. I asked the same question on reddit, and someone provided me with a functioning code.

    I leave the code here maybe it will come handy for someone in the future.

    tell application "Shortcuts Events" to run the shortcut named "Shortcut Name"

Add a Comment