Page 1 of 1

Custom preset to rename videos and subtitles

Posted: 26 Jun 2024, 02:55
by kiwichick
I have two custom presets that I use - one for renaming video files and one for renaming subtitle files. Is it possible to have FB do both in a single preset?

This is the script for renaming the video files:

Code: Select all

{n.removeAll(/[!?.]+$/).colon(', ')} ({y}) - {s00e00} - {t.removeAll(/[!?.]+$/).colon(', ').replace('(1)', '(Part 1)').replace('(2)', '(Part 2)').replace('(3)', '(Part 3)')}
The subtitle script is the same but with .eng on the end.

EDITED TO ADD: If it makes things easier, I'm renaming only srt subtitle files.

Re: Custom preset to rename videos and subtitles

Posted: 26 Jun 2024, 04:24
by rednoah
Just add {subt} at the end. It'll work for both video files and subtitles files because {subt} is only defined for subtitle files:

Format: Select all

{n.removeAll(/[!?.]+$/).colon(', ')} ({y}) - {s00e00} - {t.removeAll(/[!?.]+$/).colon(', ').replacePart(' (Part $1)')}{subt}
:arrow: {lang} and {subt} subtitle language tag

Re: Custom preset to rename videos and subtitles

Posted: 28 Jun 2024, 04:07
by kiwichick
rednoah wrote: 26 Jun 2024, 04:24 Just add {subt} at the end. It'll work for both video files and subtitles files because {subt} is only defined for subtitle files:

Format: Select all

{n.removeAll(/[!?.]+$/).colon(', ')} ({y}) - {s00e00} - {t.removeAll(/[!?.]+$/).colon(', ').replacePart(' (Part $1)')}{subt}
:arrow: {lang} and {subt} subtitle language tag
Perfect! Thank you very much.