MacOS – How to use Applescript to turn off Apple TV in iTunes

applescriptautomatoritunesmacosui

In Automator, I would need an Applescript who turn off Apple TV sound.

See this picture. I need the "Apple TV salon PT" checkbox unchecked.

enter image description here

Best Answer

This Applescript does the job very well!

tell application "iTunes" to get name of AirPlay devices
tell application "iTunes" to set selected of AirPlay device "Apple TV salon PT" to false