Disable audio streams in QuickTime Pro

Hi

I am working with QuickTime movie files that have 8 channels of audio; a 5.1 surround mix and then a Left total and a Right total. I need to pass these files through the an encoder but I must disable the Left total and Right total tracks in order to maintain the audio integrity. One way to do this is to go into the properties of the QT file (window menu → show movie properties) and then deselect the last two sound track channels.

I am hoping to script the workflow so I don’t have to manually do it for every file.

I have found one solution by recording the keystrokes:
⌘ J (get movie properties)
↓ (several times to get to track 7)
⌫ (delete the track)

repeat for the 8th and then save the file.

Is there a way to disable the track without deleting it?
Can/Should this be done with a terminal command using the QT Kit?

Thanks for your brilliance and creative insight
-Alex

Yes, this is totally possible with AppleScript!

Look at the applescript dictionary for QuickTime Player, it tells you almost everything you need to know, assuming you know basic applescript.

Open this in script editor and save it as an Application.

on open droppedItems
	tell application "QuickTime Player"
		activate
		close every window without saving
		
		repeat with theItem in droppedItems
			open theItem
			tell document 1
				stop
				set (enabled of tracks whose name contains "Sound Track" and (name contains "7" or name contains "8")) to false
				save
				close
			end tell
		end repeat
		quit
	end tell
end open

Drop the items whose Sound Tracks 7-8 you’d like to disable on the script and it will go to work. Sound tracks 7 and 8 will be disabled and therefore shouldn’t affect your encode, but will still exist in the file. BTW you need Quick Time Pro to do this, but I assume you have it already because you wouldn’t have been able to manually disable/delete tracks without it.