Rename .srt file based on .mkv in same folder

Rename preset:

For reference, the rename script (JScript):

function OnGetNewName(getNewNameData)
{
	var mkvName = "";
	var dir = DOpus.FSUtil.ReadDir(getNewNameData.item.path);
	while(!dir.complete)
	{
		var item = dir.Next();
		if (item.ext.toUpperCase() == ".MKV")
		{
			if (mkvName == "")
				mkvName = item.name_stem;
			else
				return; // Too many MKV files.
		}
	}

	if (mkvName == "")
		return; // No MKV file.

	return mkvName + ".ENG" + getNewNameData.newname_ext;
}
1 Like