How the same configuration displays different toolbar buttons on different computers

I have two computers, a work computer and an entertainment computer. The two computers share a common configuration, and I have created a new toolbar on the work computer with the name work and some buttons on it, but I don't want this toolbar to be displayed on the entertainment computer. Is there any way to control whether the toolbar is displayed or not by determining the hostname of the current computer, or whether a certain path exists? Also, if I want to display different buttons on different computers on the same toolbar, how should I do it? I noticed that version 13 has the modifier @hideblock, but I don't know how to use it.

Complete toolbars can be toggled with the Toolbar command.

To hide buttons on toolbars, put them between these buttons:

@hideblock:begin
@hideif:=%computername%=="work"
@hideblock:end
2 Likes

After testing found a bug, this command is invalid with triple button, please fix it

What are you doing exactly?

It doesn't make sense to use @hideblock on a triple-button (only around a triple-button).

A triple button will indeed not be hidden:

will look like this

2023-12-01 - 10.58.07 - BETA_E_ShareX202312__(CTC2206_-_13.0.50)

triple.dop (1.7 KB)

I customized a lot of triple buttons as bookmarks, left click to open in the current tab, right click to open in another window, middle click to open in explorer. This is very important to me, can fix it in the next beta? Also, how to write the hide button when the specified path does not exist? I tried @ifexists :!D: \colver to test, doesn't seem to work

Possible work around - a button that toggles between the two toolbars, Entertainment and Work. Put the same button on both toolbars on each computer and toggle between displaying one or the other toolbar. It's not automatic but it is only one click per session with each computer.

Here is sample code for such a button. You'll need to substitute your toolbar names.

@if:$glob:work
@set glob:work
Toolbar NAME="-Collections JEG" State=top LINE 0
Toolbar Local Close NAME="-Scrap Collection JEG"
@if:else
Toolbar NAME="-Scrap Collection JEG" State=top LINE 0 TOGGLE
Toolbar Local Close NAME="-Collections JEG"
@set glob:work=on

Triple-Buttons/Three-Buttons not being affected by @hideblock has been fixed for the next beta.

Not sure if there's a way to do that. You can make buttons which do different things when clicked, if a path exists or doesn't, but not show/hide buttons based on it. (That would potentially result in a lot of extra filesystem traffic and delays every time the toolbar was updated, since checking if a path exists can take up to 30 seconds in some cases.)

You could have an OnStartup script that checks the path and sets a variable, but that probably isn't any better than testing the computer name (i.e. 1st reply in this thread).

1 Like