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)
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)
I don’t have time to prototype this today but:
I believe you can change the Focus state using a shortcut.
You can run shortcuts from the command line using the shortcuts
tool.
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"