Increase Volume on another machine ssh (need to store password)

I think this should work but I need to store the password of the other machine (NOT SSH keys thats done)

do shell script “ssh StudioB@172.0.1.116” with administrator privileges
do shell script “sudo osascript -e set curVolume to output volume of (get volume settings)”
do shell script “sudo osascript -e set newVolume to (curVolume + 1) / 10”
do shell script “sudo osascript -e set volume newVolume”

Actually that won’t work works directly on mine as applescript only.

Many I should make it a .sh command only?

You don’t need to make an sh per se. You can run multi line osascripts as you can run multi line bash scripts. It should be something like:

do shell script "ssh StudioB@172.0.1.116 \"osascript -e 'set curVolume to output volume of (get volume settings)
set newVolume to (curVolume + 1) / 10
set volume newVolume'\""

p.s. for people that doesn;t have saved known hosts and will prompted for username and password, I have an interesting snippet here

Nice one !

That works! Time to annoy the hell out people in the office!
Actyually just so I can here it

How come this code gets louder?

and why is the output volume set as i.e. at 34 but if I use

set volume 34

its very loud?

set curVolume to output volume of (get volume settings)
set newVolume to (curVolume - 1) / 10
log curVolume
log newVolume
set volume newVolume

The set volume command is deprecated but set volume has an range from 0 to 7. When using set volume output volume you’re using a range from 0 to 100.

The number 34 is max volume when using set volume and low volume when using set volume output volume. You’re using output volume (the new format) so you should also use set volume output volume 34