Applescript to toggle subtitle and audio track in Apple DVD Player

Found a few scripts online that claim to do it. None worked. Apple DVD Player 4.6.5.

Does anyone have an idea of how to script the actions to toggle subtitle and audio track?

I’m new to apple scripting, I did find these variables in the dictionary so I assume it can be done.

Hi,

try this

property subtitleList : {1, 2}

tell application "DVD Player"
	set s to available subtitles
	if item 1 of subtitleList is less than or equal to s and item 2 of subtitleList is less than or equal to s then
		if subtitle is item 1 of subtitleList then
			set subtitle to item 2 of subtitleList
		else
			set subtitle to item 1 of subtitleList
		end if
	end if
end tell

property audioList : {2, 5}

tell application "DVD Player"
	set a to available audio tracks
	if item 1 of audioList is less than or equal to a and item 2 of audioList is less than or equal to a then
		if audio track is item 1 of audioList then
			set audio track to item 2 of audioList
		else
			set audio track to item 1 of audioList
		end if
	end if
end tell