Replace hyphens with colons using tag commands

I want to make a tag command that detects a hyphen in the filename and replaces it with a colon in the title field and vise-versa. Example:

The Matrix - Reloaded (2003).avi > The Matrix: Reloaded (2003)

The Matrix: Reloaded (2003) > The Matrix - Reloaded (2003).avi

I understand if I need to make two seperate commands, I just want both to make organizing faster;

Define 2 actions:

Action 1:
Type: Format Value
Field: TITLE
Format string: $replace(%_filename%, -,: )

Action 2:
Type: Format Value
Field: _FILENAME
Format string: $replace(title%,:, -)

Edit because of typo in the format string:
Format string: $replace(%title%,:, -)

1 Like

Thank you for the reply, the first action works but the second one always returns a syntax error.

Yes, there was a typo in the format string:
Format string: $replace(%title%,:, -)

1 Like