What is the command to refresh the titlebar?

What is the command to refresh the titlebar? I am using Leo's script "Titlebar Version 1.0",

I can thus use variables in the titlebar, and I would like to be able to refresh these variables when they change.

Best example: I can easily put the time in the titlebar, but this is the time when the lister was created, If I could refresh the titlebar at will, I would have the current time, creating a simple clock.

The "Tokens" in the titlebar code, such as source and destination directory, are already refreshed every time these directories change, so I assume that DOpus has at least a partial "Refresh Titlebar" command built in.

I'm not concerned as to whether such refreshing is event-driven or button-driven (both would be nice, but I realise that the question "What event?" would be complicated).

There's no event which would fire every second to implement some kind of title-bar clock, but..

I played around with Winamp (music player) some weeks ago and tried to fetch the playing title and always select the currently playing file automatically.
I ended up with a simple script command, which would run and poll winamp once a second until the script command is stopped/paused by modifiying a global variable (which is evaluated by the script at intervals). To get a title bar clock, I guess I would use the same approach and update all lister titles every second, instead of polling what title winamp is playing.

Here's the script.
The line containing "DOpus.Create.Command.RunCommand("SelectWinampFile OPENFOLDER");" is the place where you would put your code to iterate over all open listers to update their titles.
Command.Generic_PollWinamp.js.txt (2.55 KB)
Btw and iirc:
Once you set a lister title, it will not change anymore automatically to reflect a folders location or similar.
At this point you need to update titles on your own by any event. Once you clear the lister title (to use the default value) it should update itself as usual again.

The actual command to set the lister title is: Set LISTERTITLE="My Title"
You should take a look into the manual for this command and parameter, there are some more details on how to use it available.

Thanks very much for all that interesting detail, tbone.

  1. I am using Leo's script for the lister title because I wanted to show the version+build number in order to keep track of what DOpus version was on which of my family's computers. If I revert to using the normal command
    Set ListerTitle=""
    then, of course, I can assign a hotkey to this same button, and this gives me a button-driven updater of the time. Unfortunately, neither version nor build is accessible as an ordinary DOpus function, but only as a script function, so solving the "clock" problem, then unsolves the "display the version" problem.

I don't know any way to update the lister title, either by an event or by a button, when it has been specified by Leo's script.

I could, of course, set a particular global variable to carry the version+build every time I update DOpus. Then I could use Set ListerTitle rather than the script. Seems a bit of a clumsy way to go, though.


  1. Your method is very promising, however, because it provides an update every second, so that the clock is always correct — I wasn't expecting that at all, but this seems by far the best way forward! Unfortunately, I understand very little about scripts, and I can't work out how to adapt it. (I tried replacing the line you mentioned by the command "Set GridLines=Toggle", naively hoping that the grid-lines would flash on and off once a second, but no luck.)

Also, your script seems to assume that my lister title has been set using Set ListerTitle, rather than using Leo's script — although I'm probably missing something here.

My script sets the title using Set ListerTitle:

My apologies, Leo, but I'm lost. The Set ListerTitle has script code embedded in it in the form of ampersands and script variables, so I assumed, perhaps wrongly, that it would not work in a button.

Nevertheless, I copied the Set Listertitle command — now modified with the addition of {time} — to a button, but it would not update the time (I fiddled about with the inverted commas and tried Opus function and Script function). Of course, if I delete the version number and the surrounding ampersands and inverted commas, then it works, but I lose the version number, which was the original purpose of the script.

I copied your whole script to a button (set to Script Function), but this also did not update the time.

QUESTION: How do I command your titlebar script to run again so that the time gets updated?

The Set LISTERTITLE command does not run any script code. It is the other way around. The script builds a Set LISTERTITLE command and arguments, and runs that.

As for making the script run every second or whatever you want, I think TBone was talking about a way to do that. (But isn't there already a clock on the Windows taskbar? :slight_smile:)

I uploaded a demonstrational lister clock right here: Command: ListerClock (show a simple clock in lister title)
It is full of comments and hopefully helps you to understand some of that scripting magic which is going on. o)

Leo, thanks for that. I'm encouraged that I wasn't misunderstanding.

tbone, thank you very much for your excellent work — further comments below your post in the Scripts forum.

You're welcome! o) The world needs more programmers and basic understanding of general information technology.
In the attempt to make the world a better place, starting with DO scripting is always a good starting point! o)