Herewith a script which will pop up a dialogbox prompting for a lister name.
Upon entry of the new lister name the current lister is closed and that new specificed lister is opened
With thanks for inspiration from yonder, aussieboykie and leo in this post:
Function OnClick(ByRef clickData)
Set dlg = DOpus.Dlg
' Initialise the object to display a message with three buttons, one of which is a drop-down with multiple choices
' This dialog also has a warning icon, a text field allowing the user to enter a line of text,
' and two checkboxes which the user can turn on or off.
dlg.window = DOpus.Listers(0)
dlg.message = "You have to have this" & vbCrLf & "second line is optional"
dlg.title = "Enter Lister Name"
' dlg.buttons = "First Choice|Second Choice+Third Choice+Fourth Choice|Cancel"
' dlg.icon = "warn"
dlg.max = 128 ' enable the text field
' dlg.options(0).label = "Checkbox option 1"
' dlg.options(1).label = "Checkbox option 2"
' Show the dialog and print the results to the script log
ret = dlg.Show
DOpus.Output "Dialog.Show returned " & ret
DOpus.Output "The string you entered was " & dlg.input
' DOpus.Output "The two checkboxes were set to " & dlg.options(0).state & " and " & dlg.options(1).state
set cmd = clickData.Func.command
cmd.RunCommand("Prefs LAYOUT " & dlg.input)
For example, this will open a named layout and close all other listers on its own:
Prefs LAYOUT="xyz" LAYOUTCLOSELISTERS=yes
OTOH, if you only want to close the active window and leave others alone, you may be able to apply the desired changes to that window instead of closing it and opening a new one (which takes longer and doesn't look as nice). But it depends on what you want this for, which we still don't know.
Sorry to an extent I do not know what I want either
An easy life!!
I had been using the switch to close all listers when opening a new one but that was not what I wanted.
I know that Styles repesent a possible alternative but I have not had time to research them yet.
I have many layouts predefined over many months/years so I have some momentum with them.
I guess I could state me objective like this:
I want to change from one lister setup with several tabs displaying specific locations to another lister with it's own tabs and locations displayed easily, quickly.
I have other attributes associated with my named listers e.g. filters but mostly it is an orderd set of tabs named and displaying defined folder locations.
I became aware from a post of yours recently that Styles were a possible alternative.
Looking at Help > Preferences > Preferences Categories > Layouts and Styles it does seem that I can do this with Styles.
Maybe I should have paid more attention to your question!!!
Leo I appreciate your endless contibution to these forums I have had so much help form you for many years now thank you sir.