Add metadata from filename

This should work : Tags Mp4.dcf (2.9 KB)

Option Explicit
Function OnClick(ByRef clickData)
Dim cmd, selItem, re, artist, year, comment, title, tags, path, strCommand
	Set cmd = clickData.func.command
	cmd.deselect = false

    Set re = CreateObject("VBScript.RegExp")
	re.IgnoreCase = true
	re.Global = false
	re.Pattern = "^(.*) \[(\d{4}).*\((.*) - (.*)\) \[(.*)\].*$"

	If clickData.func.sourcetab.selected.count > 0 Then
		For Each selItem In clickData.func.sourcetab.selected
			If selItem.metadata = "video" Then
				If re.test(selItem.name) Then
					artist = re.Replace(selItem.name, "$1")
				    year = re.Replace(selItem.name, "$2")
					comment = re.Replace(selItem.name, "$3")
				    title = re.Replace(selItem.name, "$4")
					tags = re.Replace(selItem.name, "$5")
				    path = selItem
					strCommand = "SetAttr """ & path & """ META ""artist:" & artist & """ ""year:" & year & """ ""comment:" & comment & """ ""title:" & title & """ ""keywords:" & tags & """"
'					Dopus.Output "Command : " & strCommand
					cmd.RunCommand strCommand
				End If
			End If
		Next
	End If
End Function