Script column that shows custom folder date derived from a sidecar file?

Hello,

I want to create a custom script column which shows custom date for each folder that is derived from an .isodate sidecar file inside each folder. If there's no sidecar file in a folder, the entry in the column should remain blank.

Unfortunately I am not a programmer, so I tried asking ■■■■■■■ 5 mini to code this for me, but the VBScript it gave me didn't work even after numerous attempts at troubleshooting with the AI chat bot. The script column was blank even though a sidecar files was present in the folders. I could only get it to write me a working script that creates a column that shows the date taken from the manually written ISO date at the end of each folder name. That script is below.

Sadly, this is too much visual clutter so I don't really this approach. Is someone able to help me modify this script so that it reads the ISO date from a .isodate sidecar file instead, and displays it in the custom column next to each folder that holds that sidecar file?

What format is the .isodate file in? Can you post an example?

Sorry, I will be more careful next time not to post any AI generated code. The post was entirely written by me though.

I've attached the sidecar file. It's a simple file with no extension. I hope this helps.
isodate_sidecar.zip (160 Bytes)

See how you go with this. Note the column will appear in the Date and Time category.

FolderISODate.opusscriptinstall (1.0 KB)

Script code
// FolderISODate
// (c) 2026 jpott

// This is a script for Directory Opus.
// See https://www.gpsoft.com.au/endpoints/redirect.php?page=scripts for development information.



// Called by Directory Opus to initialize the script
function OnInit(initData)
{
	initData.name = "FolderISODate";
	initData.version = "1.0";
	initData.copyright = "(c) 2026 jpott";
//	initData.url = "https://resource.dopus.com/c/buttons-scripts/16";
	initData.desc = "Adds column to show contents of .isodate file within folders";
	initData.default_enable = true;
	initData.min_version = "13.0";


	var col = initData.AddColumn();
	col.name = "FolderISODate";
	col.method = "OnFolderISODate";
	col.label = "FolderISODate";
	col.justify = "right";
	col.category = "date";
	col.type = "date";
	col.autogroup = true;
}


// Implement the FolderISODate column
function OnFolderISODate(scriptColData)
{
	if (!scriptColData.item.is_dir)
		return;

	var fsutil = DOpus.FSUtil();
	var path = fsutil.NewPath(scriptColData.item.realpath);
	path.Add(".isodate");
	if (!fsutil.Exists(path))
		return;

	var file = fsutil.OpenFile(path);
	var data = file.Read();
	if (!data || !data.size)
		return;

	var st = DOpus.Create().StringTools();
	var date = st.Decode(data, "utf-8");
	scriptColData.value = DOpus.Create.Date(date);		
}
3 Likes

This worked beautifully! Thank you so much!!

1 Like