Get precise volume percentage using Terminal

Ok well I've dialed everything in the way I like it where I am maximizing my gain structure. I read that you can type code into Terminal to get the value of the fader in a 0-100 % value. I'm trying to get the value from the fader in the Apple TV app on my M2 Ultra Studio but... every code I've tried does not work... I've tried...



osascript -e 'get volume settings'



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



osascript -e "set volume output volume N"


I keep getting this error....


output volume:missing value, input volume:missing value, alert volume:13, output muted:missing value


I have the Apple TV app open and the slider is set to about 75% of the way up but I'd really love to know the number/percentage volume of where it's at currently. Does anyone know of a terminal line code that will work?



Apple TV 4K

Posted on Mar 27, 2026 3:40 PM

Reply
Question marked as Top-ranking reply

Posted on Apr 6, 2026 12:25 PM

Short version - you're doing it wrong :)


osascript -e 'get volume settings'


'get volume settings' is the global system volume control. The TV app has its own volume controller, and represents a percentage of the system volume level. You need to ask the TV app itself.


if you're trying to do this via AppleScript:


tell application "TV" to get sound volume

tell application "TV" to set sound volume to 80


If using osascript:


osascript -e 'tell application "TV" to get sound volume'

osascript -e 'tell application "TV" to set sound volume to 80'

12 replies
Question marked as Top-ranking reply

Apr 6, 2026 12:25 PM in response to goombot

Short version - you're doing it wrong :)


osascript -e 'get volume settings'


'get volume settings' is the global system volume control. The TV app has its own volume controller, and represents a percentage of the system volume level. You need to ask the TV app itself.


if you're trying to do this via AppleScript:


tell application "TV" to get sound volume

tell application "TV" to set sound volume to 80


If using osascript:


osascript -e 'tell application "TV" to get sound volume'

osascript -e 'tell application "TV" to set sound volume to 80'

Apr 6, 2026 2:12 PM in response to Camelot

Ok that worked finally!. thank you. I'm using Terminal to do it so the osascript worked. I do have another question, I'd like to do it with Apple Music app as well. I changed "TV" to "Music" and I tried "MUSIC" and neither worked. Any idea why not?


I tried this....


osascript -e 'tell application “Music” to get sound volume'


and this is the error I got...


17:18: syntax error: Expected expression, property or key form, etc. but found unknown token. (-2741)


And finally, how would the code be to check the system volume? thank you.

Apr 7, 2026 12:25 PM in response to goombot

> I'd like to do it with Apple Music app as well. I changed "TV" to "Music" and I tried "MUSIC" and neither worked.


Because you copied the script from these forums? :)


If you look closely, "Music" is wrapped in curly quotes, which the Terminal abhors.


“Music”


is not the same as:


"Music"


It's a subtle, but critical difference. Try again with the plain quotes and you should be fine.


> And finally, how would the code be to check the system volume? thank you.


Your original code queried the system volume:


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

Apr 11, 2026 2:32 PM in response to goombot

goombot wrote:

That all works great. Thank you very much. The only thing that still doesn't work is getting the System volume.

I tried your's

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

and this..

osascript -e 'get volume settings'

and neither worked. What am I still missing? thank you.

I copied & pasted both from @Camelot's post, and both work as is for me in the Terminal on Ventura.


Are you testing them by themselves in the Terminal, or are they contained within a script which might be influencing the results?

Get precise volume percentage using Terminal

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.