A token to add the version number to the Lister Title

It would help with updating if the version number could be printed in the Lister Title. I could only do this at the moment by going to Preferences - - > Display - - > Options and typing it in each time there is an update.

Would it be possible to add to the Custom Title the token %V - Installed version of Directory Opus?

Edit Jan 12, 2020: Added notoggle: to fix problems with saved listers/layouts.

Save this somewhere, then drag it to Preferences / Toolbars / Scripts:

Titlebar_Version.vbs.txt (520 Bytes)

option explicit

Function OnInit(initData)
	initData.name = "Titlebar Version"
	initData.desc = "Puts the Opus version number into lister titlebars"
	initData.copyright = "(C) 2014 Leo Davidson"
	initData.version = "1.1"
	initData.default_enable = true
End Function

Function OnOpenLister(openListerData)
	Dim cmd
	set cmd = DOpus.NewCommand
	cmd.SetSourceTab openListerData.lister.activetab
	cmd.RunCommand "Set LISTERTITLE=""notoggle:%N - (Directory Opus " & DOpus.version.product & ")"""
End Function

Thanks very much Leo (and astonishingly quick!) It's now very easy to edit the script to make the lister title whatever I want.

I'm guessing that this script writes something to the configuration files somewhere.

Last week I did a full rebuild of my PC (after backing up everything including my full DOpus configuration). Since the rebuild, my DOpus lister titlebars were not showing the version number. I checked that the script had been loaded with the config restore - it was and was ticked in preferences/scripts.

Now, if I un-tick the script, the version number is present, if I tick the script again, the version number disappears. I have fully exited DOPus as well as rebooting and the symptoms are the same. I even deleted the script and I still have the version number in my titlebars (which is good actually :slight_smile: ).

Not a major issue but I thought it was worth mentioning to see what is happening here.

I'm not sure why that would happen.

If a lister title is set and you save that lister into a layout, the title is saved in the layout, which is a config file. Aside from that, the only other thing that could be considered part of the config is the script itself.

Thanks for the reply Leo. I think I understand the logic behind what had happened.

To get back to the 'correct' operation of the script, I set the lister as default and saved the layout. This saved the layout (*.oll) file with no version number. I then installed the script and activated it and normal service appears to be restored.

I don't understand why or how the script on/off actions were reversed, nor what would happen when a later version of DOpus was installed. Would it continue to be reversed and would the lister title get updated to the latest version number?

I've updated the script above to fix a problem which I think is what @Rebel154 was seeing.

1 Like