Skip to content

Instantly share code, notes, and snippets.

@aaroneaton
Last active January 5, 2016 15:46
Show Gist options
  • Save aaroneaton/3955554 to your computer and use it in GitHub Desktop.
Save aaroneaton/3955554 to your computer and use it in GitHub Desktop.
AppleScript:Do Not Disturb on Microsoft Link
-- Save the foreground application
tell application "System Events"
set currentApp to name of 1st process whose frontmost is true
end tell
-- Get Lync in the foreground so we can use the menu
tell application "Microsoft Lync"
activate
end tell
-- Set your status to 'Do Not Disturb'
tell application "System Events"
tell process "Microsoft Lync"
tell menu bar 1
tell menu bar item "Status"
tell menu "Status"
click menu item "Do Not Disturb"
end tell
end tell
end tell
end tell
end tell
-- Return to your previous application
tell application currentApp
activate
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment