Renaming Sidecar files automatically once main files renamed


I have a bunch of video files recorded from different cameras (could be GoPro, could be from Drones) and these often can have side-car style files along side them that i sometimes wish to keep. I often rename these video files to be Date/Time stamp names using internal metadata of recorded time etc instead of the default generic number files. The trick is.. that i'd like to have the sidecar files renamed to those names as well but of cousre i can't use the same method with metadata as they do not have it.

Would anyone know a way to automagically rename them to the same as the main file?


Scripting, this is an example and you need to modify it.

function OnClick(clickData)
	var func = clickData.func;
	var sourcetab = func.sourcetab;
    var dest = func.desttab.path + "";
	if (!sourcetab.lister.dual || sourcetab.path + "" == dest)

	var cmd = func.command;
	cmd.deselect = false;

    // Add string trim() method
	String.prototype.trim = function(s){s=s||"\\s";return this.replace(new RegExp("^("+s+"){1,}\|("+s+"){1,}$","g"),"")}
	Dlg = func.Dlg;
	var ext = func.Dlg.GetString("Enter the extension of the destination pane", "mp4");
	if (ext) {
	    ext = ext.trim();
	} else {
	    Dlg.message = "No extension entered, script terminated!";
        Dlg.buttons = "&OK";

	var fsu = DOpus.FSUtil;
	for (var e = new Enumerator(sourcetab.files); !e.atEnd(); e.moveNext() )
	    eItem = e.item();
	    if (eItem.metadata == "video") {
		    var created = eItem.create.Format('D#yyyy-MM-dd T#HH:mm:ss');
			var modified = eItem.modify.Format('D#yyyy-MM-dd T#HH:mm:ss');
		    var basename = eItem.name_stem;
			var destItem = dest + "\\" + basename + "." + ext;
			if (fsu.Exists(destItem)) {
				cmd.AddLine('SetAttr "' + destItem + '" Meta "createdate:' + created + '"')
				cmd.AddLine('SetAttr "' + destItem + '" Meta "lastmodifieddate:' + modified + '"')
	if (cmd.count)

	Dlg.message = "Execution succeed!";
	Dlg.buttons = "&OK";
1 Like

Hi WKen,

Thanks for the reply. And wow.. that looks far to heavy for my simple brain to grasp! Although i can probably guarantee its to complex for me to grasp. But i will study it when i get the chance. Thanks for that!

If you're renaming them via the Rename dialog (i.e. not inline rename via F2 or long-click), there's an option in there to rename matching files (same name but different extensions) in the same way.

The main caveat is the main file may need to be first in the list. Depending on the two extensions, that might mean reverse-sorting before doing the rename.

1 Like

Hi Leo,

Well now i feel even more stupid for not having seen that option!

I haven't tested it out yet but if it works as it seems... it should do the trick as i'm using a rename preset that's saved in that dialog.

I have been using "ReNamer Lite" by den4b as it was the only one i could find that'd do such a metadata rename prior to me having discovered DO (and then being familiar enough with it to try and get it to do a similar thing). Although i'm sure there was a reason i couldn't use DO for renaming fully as yet (something to do with the differences between certain video files not working as expected between the two and discovering there are time offsets within the stored metadata that i now have to account for etc etc.

I will test my main two file types once i get the chance and hopefully this will resolve my sidecar issue! Thank you.

1 Like

We're going to overhaul the video metadata support soon, which may help with the other issues.

1 Like

Awesome that's nice to hear. Looking forward to that (and all of the other goodies!).

Love Directory Opus! Awesome program that is the very high example of professionally developed software. Something a lot of developers nowadays fail to achieve. They'd much rather infuriate the very users they claim to provide for with bloat... very poor and backwards heading User Interfaces.. with infuriating choices like rental models and features that no one asks for all whilst making the existing good functionality less functional. DO doesn't do this and is like software of old.. made powerful and with options out the wazoo!

I can't speak highly enough of it. Well done to all involved.

PS. Oh and the fact its Australian really gives me some pride!

1 Like