Decrease VLC player output volume stealthilyI want to lower the volume

I want to lower the volume of the VLC application.

tell application “VLC” to activate – put the window in front :frowning:
repeat 3 times
tell application “System Events” to key code 125 using {command down}
end repeat

The code lowers the output volume of the VLC player but brings the application window to the front of the screen.
Is it possible to decrease the volume of VLC without the presence of the player on the screen?

Model: iMac
AppleScript: 2.7
Browser: Google Chrome
Operating System: macOS 10.14

I don’t know that I’d call them ‘stealthy’ but VLC has volumeUp and volumeDown commands.

Supposedly, there are 32 steps from 0% to 400% but my quick impression is that each use of the command affects the volume by an actual 5% but who knows. Changing the integer doesn’t seem to make a difference but I get an error when I omit it. You can ‘tell’ a specific window (if that’s relevant) but you may need to add an integer (whose value is meaningless) to each line.

So, to lower the volume by a bit (probably 20%), try this:

tell application "VLC"
	volumeDown
	volumeDown
	volumeDown
	volumeDown
end tell

Thank you very much, Mockman :slight_smile:

I’m learning to use AppleScript And I still don’t know the application dictionaries well.

Your solution perfectly meets the needs.

Thanks again

Glad it works for you.