Problems / Questions regarding file preview

FYI: When I am in the command editor, contrary to How to use buttons and scripts from this forum - #2 by Leo, under "Function" in the drop-down "Script Function" is not listed. Only when I click on "Advanced ..." further down, "Script Function" is shown as the function, with the following content:

  • for script type JScript:
function OnClick(clickData)
{
	// This is the default example OnClick script, to help get you started.
	// (You can use the "Default" menu above to replace this with your own default.)
	// 
	// Some essentials (see Scripting Reference in the manual for the rest):
	// - clickData.func.command:
	//     Command object.
	//     Preconfigured with source, destination and selected items.
	//     To change source/dest:
	//       cmd.SetSource, .SetSourceTab, .SetDest, .SetDestTab.
	//     To change files/folders acted upon:
	//       cmd.ClearFiles, .AddFile, .AddFilesFromFile, .RemoveFile, etc.
	//     To run a simple, single-line command:
	//       cmd.RunCommand("Help ABOUT");
	//     To run a multi-line command:
	//       cmd.Clear();
	//       cmd.AddLine("Help ABOUT");
	//       cmd.AddLine("Help LICENCEMANAGER");
	//       cmd.Run();
	// - clickData.func.Dlg
	//     Dialog object for showing message boxes and other UI.
	//     Preconfigured with the source tab as its parent window.
	// - clickData.func.sourcetab and .desttab:
	//     Source and destination folder tabs.
	//     Access to data such as:
	//       tab.selected, .selected_dirs, .selected_files.
	//       tab.all, .dirs, .files.
	//       tab.path (tab's folder path).
	//       tab.lister (top-level lister that contains the tab).
	//       tab.right (tells you if tab is on the left or right).
	//       etc.
	// --------------------------------------------------------
	DOpus.ClearOutput();
	// --------------------------------------------------------
	var cmd = clickData.func.command;
	cmd.deselect = false; // Prevent automatic deselection
	// --------------------------------------------------------
	cmd.RunCommand("Set VIEW=Details");
	// --------------------------------------------------------
	DOpus.Output("Selected items in " + clickData.func.sourcetab.path + ":");
	if (clickData.func.sourcetab.selected.count == 0)
	{
		DOpus.Output("  (none)");
	}
	else
	{
		for (var eSel = new Enumerator(clickData.func.sourcetab.selected); !eSel.atEnd(); eSel.moveNext())
		{
			if (eSel.item().is_dir)
			{
				DOpus.Output("  (d) " + eSel.item().RealPath);
			}
			else
			{
				DOpus.Output("  (f) " + eSel.item().RealPath);
			}
		}
	}
	// --------------------------------------------------------
	DOpus.Output("Folders below C:\\ root:");
	var folderEnum = DOpus.FSUtil.ReadDir("C:\\");
	while (!folderEnum.complete)
	{
		var folderItem = folderEnum.Next();
		if (folderItem.is_dir)
		{
			DOpus.Output("  " + folderItem.RealPath);
		}
	}
	// --------------------------------------------------------
	DOpus.Output("Folder tabs open across all windows:");
	for(var eListers = new Enumerator(DOpus.listers); !eListers.atEnd(); eListers.moveNext())
	{
		for (var eTabs = new Enumerator(eListers.item().tabs); !eTabs.atEnd(); eTabs.moveNext())
		{
			DOpus.Output("  " + eTabs.item().path);
		}
	}
	// --------------------------------------------------------
}
  • for script type VBScript:
> Option Explicit
> Function OnClick(ByRef clickData)
> 	' This is the default example OnClick script, to help get you started.
> 	' (You can use the "Default" menu above to replace this with your own default.)
> 	' 
> 	' Some essentials (see Scripting Reference in the manual for the rest):
> 	' - clickData.func.command:
> 	'     Command object.
> 	'     Preconfigured with source, destination and selected items.
> 	'     To change source/dest:
> 	'       cmd.SetSource, .SetSourceTab, .SetDest, .SetDestTab.
> 	'     To change files/folders acted upon:
> 	'       cmd.ClearFiles, .AddFile, .AddFilesFromFile, .RemoveFile, etc.
> 	'     To run a simple, single-line command:
> 	'       cmd.RunCommand "Help ABOUT"
> 	'     To run a multi-line command:
> 	'       cmd.Clear
> 	'       cmd.AddLine "Help ABOUT"
> 	'       cmd.AddLine "Help LICENCEMANAGER"
> 	'       cmd.Run
> 	' - clickData.func.Dlg
> 	'     Dialog object for showing message boxes and other UI.
> 	'     Preconfigured with the source tab as its parent window.
> 	' - clickData.func.sourcetab and .desttab:
> 	'     Source and destination folder tabs.
> 	'     Access to data such as:
> 	'       tab.selected, .selected_dirs, .selected_files.
> 	'       tab.all, .dirs, .files.
> 	'       tab.path (tab's folder path).
> 	'       tab.lister (top-level lister that contains the tab).
> 	'       tab.right (tells you if tab is on the left or right).
> 	'       etc.
> 	' ---------------------------------------------------------
> 	DOpus.ClearOutput
> 	Dim cmd, lister, tab, selItem, folderEnum, folderItem
> 	' ---------------------------------------------------------
> 	Set cmd = clickData.func.command
> 	cmd.deselect = false ' Prevent automatic deselection
> 	' ---------------------------------------------------------
> 	cmd.RunCommand "Set VIEW=Details"
> 	' ---------------------------------------------------------
> 	DOpus.Output "Selected items in " & clickData.func.sourcetab.path & ":"
> 	If clickData.func.sourcetab.selected.count = 0 Then
> 		DOpus.Output "  (none)"
> 	Else
> 		For Each selItem in clickData.func.sourcetab.selected
> 			If (selItem.is_dir) Then
> 				DOpus.Output "  (d) " & selItem.RealPath
> 			Else
> 				DOpus.Output "  (f) " & selItem.RealPath
> 			End If
> 		Next
> 	End If
> 	' ---------------------------------------------------------
> 	DOpus.Output "Folders below C:\ root:"
> 	Set folderEnum = DOpus.FSUtil.ReadDir("C:\")
> 	Do While (Not folderEnum.complete)
> 		Set folderItem = folderEnum.Next
> 		If (folderItem.is_dir) Then
> 			DOpus.Output "  " & folderItem.RealPath
> 		End If
> 	Loop
> 	' ---------------------------------------------------------
> 	DOpus.Output "Folder tabs open across all windows:"
> 	For Each lister In DOpus.listers
> 		For Each tab In lister.tabs
> 			DOpus.Output "  " & tab.path
> 		Next
> 	Next
> 	' ---------------------------------------------------------
> End Function

... but WHERE I have to input "Set VIEWPANESIZE=700" here ?
... If I enter here (or directly in the line "function") => "Set VIEWPANESIZE=700" ALONE without anything, an error is displayed when "executing", no matter if executed as JScript or VBScript.
So do you have a suggestion?