I need help with an idea that would definitely solve a great amount of time, but I'm not sure how to implement it.

Basically I would want to automate the tasks I manually do with MKVToolNix, which are select the correct chapter index (the one with more languages available), deselect the audio tracks leaving it as Dual, mark the default track to a desired language then remux it.

So my idea is an script that can perform this tasks using mkvmerge from command line.

I think should be possible but I don't know how to program a lot, so this can be a rough challenge for. I'd appreciate any help or any correction if something stated can be mislead.