Trying to create one-click Opus restore/backup buttons

I frequently export the Opus setup on my desktop over to my laptop. This involves a bit of interaction, so I've tried to create two buttons: one to automate the backup from the desktop to Dropbox, the other to tweak the settings on the laptop after import. Neither of these work quite as I'd hoped.

First problem: the backup button uses

Prefs BACKUP=all TO "C:\Dropbox\Archives and Backups\DOpus\Configs"

I'd assumed (hoped) that by not supplying a filename, Opus would just use the same default format it uses if you follow the wizard normally (i.e. "Neil - Opus Config - 2018-01-18.ocb") but instead it just creates "Configs.ocb" whether or not I use a trailing slash.

Is there any way to get Opus to generate the default style and date of filename using Prefs, or would it have to be scripting?

Second problem: the button I use on the laptop to tweak stuff includes this:

Toolbar "NJM - Places" CLOSE
Toolbar "NJM - Places (Surface)"

Prefs SETDEFAULTLISTER=force,quiet

The first two lines work as expected: existing bar is closed, new bar is opened. However, the last line doesn't appear to save the change. I guessed that it's because all of the lines are working asynchronously, so perhaps the Prefs line is executed before the previous two have completed, hence saving the existing state rather than the new one. I tried appending @sync to each line in the button, but that fails because it makes Opus think they're Windows commands, which it subsequently fails to find. Alternatively, perhaps that particular command doesn't actually save the toolbars?

How can I get the prefs to save correctly (including the toolbars)?

Third problem: I want to change the file display font size so it's more touchscreen friendly - only a couple of points. I don't see anything in the documentation that seems to do that using the command line. Is there a way?

Thanks in advance.

Solve that by specifying the filename. You can use {date|YYYY-MM-dd} to get the current date in the format the wizard usually uses.

This should work:

Toolbar "NJM - Places" CLOSE
Toolbar "NJM - Places (Surface)"
dopusrt /acmd Toolbar SETDEFAULT=quiet

Set FONTSCALE can adjust font size on the fly, but it's not really meant for adjusting the global font configuration.

You can make it do that (with a few quirks) using scripting, though. The main quirk is you'll have a little icon indicating the font size has been adjusted from the normal size.

This script does that based on the layout name, but you could edit it to work based on the computer name, or an environment variable, or something else:

Thanks very much, Leo. First solution works as advertised, and the third one I'll look into when I have more time. However, the second still doesn't work for me: while the toolbars change in the current lister, new listers still use the old bar.

If I try it on a lister which has neither Places bar open,the bar appears but new default listers don't have either Places toolbar. I think it's still a timing issue: I've added a command to the end of the list to open the preferences window so I can manually change the font size, and the prefs window opens about a second before the new toolbar does. I assume that the Toolbar command must have been completed before the new bar opened (and probably before the old bar was removed).

Since your solution uses an external command, I tried using it for the previous line in the button, prefixing the latter line with @sync:

dopusrt /acmd Toolbar "NJM - Places (Surface)"
@sync:dopusrt /acmd Toolbar SETDEFAULT=quiet

This seems to do it, but only when the first line uses dopusrt as well. I assume that @sync and @async only take external commands into account, not internal ones, so without a previous external command to wait for, the second line must fire immediately.

Anyway, thanks as always for the advice.

I forgot to say, you should turn on Preferences / Launching Opus / Default Lister / Ignore toolbars of Default Lister.

So there's a difference between the default toolbars and the toolbars of the default lister. I didn't realise that.

I was about to write a "spoke too soon" post, since my previous solution didn't reliably work (though it was better after I used dopusrt to close the old toolbar as well), but your settings change seems to fix it too, and I daresay with less kludge. Thanks again.

1 Like