MacOS – Applescript remote control volume

applescriptmacossound-volume

Wondering how to turn up the volume on my computer from another computer.

set volume 4 of machine remMachine

doesn't work
Any suggestions?

Best Answer

In order to remotely control a Mac, say your desktop machine, you must first set it up for commands to be sent to it. To do this, launch System Preferences > Sharing on the Mac you want to control. Click the box next to Remote Apple Events, and set user restrictions if you need to.

Next, you will need the IP address. In System Preferences, switch to Network and locate your machine’s IP address. It should be something like, 192.168.0.3. Copy that address to proceed to the next step. You can also use the machine’s Bonjour name which can be found at the top of the Sharing pane in System Preferences. Its address will be spelled similar to this one: "smith-nancy-computer.local"

Now from another Mac, create your applescript like this:

tell application "Finder" of machine "eppc://192.163.0.3"
set volume 4
end tell

Sidenote:

Unfortunately I don't have a second Mac to test this on, so if anyone can improve this answer if it doesn't work, please feel free to make changes or add comments.

Related Question