Skip to content

Instantly share code, notes, and snippets.

@mgarciate
Created October 4, 2016 15:10
Show Gist options
  • Select an option

  • Save mgarciate/ddf731c4bcdeea316c4321d2f3f1be67 to your computer and use it in GitHub Desktop.

Select an option

Save mgarciate/ddf731c4bcdeea316c4321d2f3f1be67 to your computer and use it in GitHub Desktop.
Mute mac for n seconds through Apple Script
//Code to mute and unmute macs for n seconds through Applescript Editor
set volume with output muted
set startDelayDate to (time of (current date))
global shouldRepeat
set shouldRepeat to yes
repeat while shouldRepeat is equal to yes
delay (1)
if (((time of (current date)) - startDelayDate) ≥ 50) then
set shouldRepeat to no
end if
end repeat
set volume without output muted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment