Skip to content

Instantly share code, notes, and snippets.

@XuankangLin
Created September 29, 2016 18:24
Show Gist options
  • Save XuankangLin/e1cdadf96e9857c5f3a68fb8e6973312 to your computer and use it in GitHub Desktop.
Save XuankangLin/e1cdadf96e9857c5f3a68fb8e6973312 to your computer and use it in GitHub Desktop.
Volume Up or Volume Down applescript for alfred
on alfred_script(q)
-- your script here
set current to output volume of (get volume settings)
set old to current
set current to current + 10
if (current > 100) then
set current to 100
end if
set volume output volume current
set message to "The volume is now " & current & "/100"
return message
end alfred_script
-- Above is for Volume Up
-- Below is for Volume Down
on alfred_script(q)
-- your script here
set current to output volume of (get volume settings)
set old to current
set current to current - 10
if (current < 0) then
set current to 0
end if
set volume output volume current
set message to "The volume is now " & current & "/100"
return message
end alfred_script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment