How to batch combine mkv and srt files to mp4 with ffmpeg
Using and adapting code from 

https://stackoverflow.com/questions/12907517/extracting-file-extensions-from-applescript-paths

Add to the top of your code:

-- overcome finder limitation...
set text item delimiters to "."


then later extract the name and extension portions...

if new_item contains "." then set item_ext to (text item 2 of new_item) as text
if new_item contains "." then set item_name to (text items 1 thru -2 of new_item) as text


That should do it... :)