Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm using a PC keyboard on Mac OS. I can use the menubar to control the volume, but are there any keyboard shortcuts I can use to change the system volume?

Or perhaps a simple script or solution I can install to be able to set the volume using the keyboard.

share|improve this question

5 Answers 5

You can buy the pro version of Sizzling Keys. It is a preference pane that allows you to define a custom keyboard shortcut for modifying system volume, among lots of other things.


Alternatively, you can modify system volume using AppleScript.

Open up AppleScript Editor and enter

set volume output volume 100

Volume is on a scale of 0 to 100. You can either set an absolute value (e.g. 100 for full volume), or create scripts that increase/decrease, such as the following:

set vol to output volume of (get volume settings)
if vol > 90 then # 100 max
    set volume output volume 100
else
    set volume output volume (vol + 10)
end if

For Volume Down:

set vol to output volume of (get volume settings)
if vol < 10 then # 0 is min
    set volume output volume 0
else
    set volume output volume (vol - 10)
end if

If you'd like to replicate the feedback sound that normally occurs when you change volume, you could add the following to the script:

    do shell script "afplay /System/Library/Sounds/Pop.aiff"

You can save scripts as these as applications, or integrate them into the Services menu using Automator as an input-less service. You can define keyboard shortcuts for services in System Preferences » Keyboard » Keyboard Shortcuts » Services

share|improve this answer
    
This was perfect. For those who haven't done it before: run Automator, File/New/Service, under Service receives selected choose "no input", on the left next to Variables search for "Run AppleScript" and double-click it, paste one of these scripts below where it says "your script goes here", click green run button to test it, save as "Volume Up" or "Volume Down", System Prefs/Keyboard/Shortcuts, select "Services" on the left, these should show up at the bottom where you can assign keyboard shortcuts. I had to run the services manually from the services menu once before the shortcuts worked. –  nonagon Jun 13 at 18:44

I've packaged up a set of AppleScript services and instructions that let you control system & iTunes volume, as well as play/pause & next/prev on any keyboard in Lion.

http://gskinner.com/blog/archives/2011/10/media-keys-in-osx-for-any-keyboard.html

share|improve this answer
1  
Welcome to Super User! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. –  Tom Wijsman Oct 31 '11 at 19:07

Old thread but the way I solved it is via a single line applescript based on other answers

Increase volume by 10%

osascript -e 'set volume output volume ((output volume of (get volume settings)) + 10)'

Decrease volume by 10%

osascript -e 'set volume output volume ((output volume of (get volume settings)) - 10)'

Actually ended up writing a blog post about using it with Alfred app: http://arif.im/system-volume-control-using-alfred/

share|improve this answer
    
Hi your blog post seems to be down (502 bad gateway) do you still host a cached copy? –  Leon Fedotov Sep 22 '13 at 22:43

KeyRemap4MacBook (works on all Macs, not just MacBooks) can remap function keys to control volume, and has been working seamlessly for me so far. In the control panel, search for "F9 to mute" etc.

share|improve this answer
    
It doesn't work if you don't have at least one keyboard (like the built-in keyboard of a laptop) that has the media keys. You can also map different keys to the media keys in private.xml. –  ؘؘؘ Feb 18 '13 at 16:29

The F1 to F12 keys on the PC keyboard should do the same thing. I assume you have had no issues with substituting the "Windows" key for key. If the F1 to F12 keys don't work, go to system preferences,keyboard & mouse, keyboard and make the choices from there, whether to use the F keys directly or with the fn key qualifier. Regards Paul

share|improve this answer
4  
PC keyboard, as in not usually equipped with an Fn key. –  Daniel Beck Dec 21 '10 at 8:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.