Show AUTOFILELIST LISTSIBLINGS support video and other non-image type file

when open video or other non-image type file in standalone viewer, the viewer will not generate file list for those file that are in same directory as the opened file.

this is very inconvenient.

leo say below in Show AUTOFILELIST LISTSIBLINGS does not work for videos

That is not a bug. The viewer never adds videos, documents or any other non-image types in the auto-generated next/prev list.

You can get them in the list by selecting them explicitly and then running the Show command on them, but it won't autopopulate the list with them.

(This is mainly because they tend to get in the way of scrolling through image lists, and in the case of documents will kick the viewer out of fullscreen mode. Also because they tend to be viewed as individual things.)

i think there are many people that need this feature, so i post this.

2 Likes

It can be done with a script, but perhaps having it built-in would be better.

Standalone Viewer automatically adds all files.opusscriptinstall (1.3 KB)

Code
// Standalone Viewer automatically adds all files
// (c) 2025.09.02 Ken

// 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 = "Standalone Viewer automatically adds all files";
	initData.version = "1.0";
	initData.copyright = "(c) 2025.09.02 Ken";
//	initData.url = "https://resource.dopus.com/c/buttons-scripts/16";
	initData.desc = "Support Previous file/Next file";
	initData.default_enable = true;
	initData.min_version = "13.0";


}

// Called when an event takes place in the standalone viewer
function OnViewerEvent(viewerEventData)
{
	if (viewerEventData.event == "load") {
		var viewer = viewerEventData.viewer;
		var files = viewer.parenttab.files;
		var viewerItem = viewer.current;
		var fsu = DOpus.FSUtil;
		var tabFiles = DOpus.Create.Vector();
		for (var i=0; i<files.count; i++) {	// Only add supported files
			var eItem = files(i);
			if (fsu.Exists(eItem) && fsu.GetType(eItem) != "dir") {
				if (eItem.metadata.other && eItem.metadata.other.target_type)
					eItem = eItem.metadata.other.target
				tabFiles.push_back(eItem)
			}
		}

		if (tabFiles.count != viewer.files.count) {
			for (var eItem = new Enumerator(viewer.files); !eItem.atEnd(); eItem.moveNext() ) {
				try { viewer.RemoveFile(eItem.item()) } catch (err) {};
	        }
			for (var i=0; i<tabFiles.count; i++) {
				var eItem = tabFiles(i);
				if (eItem + "" != viewerItem) {
					viewer.addFile(eItem, i);
				}
			}
		}
		// Focus item
		/*var cmd = DOpus.Create.Command;
		cmd.clearFiles;
		cmd.addFile(viewerItem);
		cmd.RunCommand('Select FROMSCRIPT SETFOCUS DESELECTNOMATCH');*/
	}
}
1 Like

We'll add an option for this in the next beta.

3 Likes

nice ! thank you ! :face_blowing_a_kiss: