Transmission-gtk : run script after torrent completes?

Hi, I have transmission-gtk running on my raspberry pi2 with Ubuntu mate.

I wanted to automatically convert the dts audio in a video to ac3 using a script after the torrent completes.

I found the script mkvdts2ac3 https://github.com/JakeWharton/mkvdts2ac3 online but as I’m new to this I don’t know how to modify the script to use the torrent’s full filename because normally the path to the file is specified as a command line argument.

As a side note, I would like to also create another folder (with the same name as the torrent’s folder) in another location and move the converted video there. Again since I’m new to scripting I wouldn’t know how to get the folder name to begin with.

Any ideas ? Thanks