Testing for Presence of Toolbar

Jun 2, 2008
Newton, MA
Can anyone suggest a way to test whether a TCMD toolbar is present, i.e., if there is at least one button? I have a script in which I want to reload my standard toolbar only if no toolbar is already present. I have not been able to find a system variable for that (_tctabactive does not do it).
If I clear the toolbar with;
tctoolbar /c
...and then write the empty toolbar to a file, the file has a size of 0 bytes.

Thus, there are no buttons on the toolbar.

If I reset the toolbar to the definition in TCMD.INI;
tctoolbar /i
...and then write the toolbar to a file, the file has a size of 3,550 (YMMV).

if %@filesize[e:\utils\stuff.txt] eq 0 echo No Toolbar with buttons

Jun 2, 2008
Newton, MA
Thanks. I think I can use that approach (though a system variable might have been nicer). One problem I ran into is that, at least with v25, the command "tctoolbar /w junk.txt" does not write to the file. I have to include a fully qualified path ("tctoolbar /w %@full[junk.txt]". That's weird. Actually, even that isn't always working. I'll have to check this out in version 27.
Jun 2, 2008
Newton, MA
I also ran into another problem because my new computer is so fast. After writing out the toolbar file, I have to add a delay before checking the size. If I don't, either the size registers as zero or the file does not even get written (not sure which, but my testing fails).
Jun 2, 2008
Newton, MA
I finally gave up on this approach. The TCTOOLBAR command with the /W option does not work correctly. In both versions 25 and 27, when I specify a simple file name (tctoolbar /w temp.txt), no file is written out, even when I have a very complex toolbar with multiple tabs and buttons clearly visible. If I use a file name with a path (tctoolbar /w c:\temp.txt), a file is created. But now I discovered that it does not necessarily contain the data for the currently visible toolbar. When I started up TCMD, no toolbar appeared. I then issued the command, and a file was written with what looked like the content of the toolbar I wanted to have but which was not visible.

My new approach is to test for the first TCC tab in TCMD. In that case, I clear and reload the toolbar from my configuration file. After that, new TCC tabs leave the toolbar alone, so it stays in the tab I have selected instead of reverting to the first tab.

Rex, can you explain what is going on with the /W option?
Similar threads
Thread starter Title Forum Replies Date
cgunhouse One of the Focuses of V17 Beta Testing Should Be Command Line Parsing Support 1
M Testing my e-mail access Support 1
C testing Support 1
S Hard links - detecting their presence Support 2
C Fixed V25 crashes when adding and then removing in the tabbed toolbar Support 3
vefatica Start VIEW with the toolbar showing? Support 5
vefatica VIEW ... remember no toolbar Support 0
Glenn Bowes WAD TOOLBAR Button Definations are different v19 to v20 Support 8
Alpengreis [v19.0.32 (x64)] Problem with [Options, Tabbed Toolbar, Add Button] in german language Support 1
D V19: toolbar /r "path\tctoolbar.ini" Support 1
vefatica Fixed Crash removing toolbar tab Support 1
vefatica Tabbed toolbar hidden ... not remembered! Support 11
rps Fixed Configure TCMD/TCC Tabbed toolbar buttons not persistant Support 3
Jay Sage Getting Quote Characters into a Toolbar Tab Support 12
Jay Sage Toolbar Update to INI File Not Working Support 10
D TCMD16 Delete Toolbar Button bug Support 7
Jay Sage Positioning of Tabbed Toolbar Support 4
vefatica Tabbed toolbar? Support 7
cgunhouse ToolBar Button Problem Support 11
T TCTOOLBAR /C & TCTOOLBAR /I should reload toolbar from TCMD.INI, right? Support 1
E Problems with Tabbed Toolbar Support 2
scottb Toolbar filter by directory attribute /A:D fails Support 1
Jay Sage More on Problem with Tabbed Toolbar Support 0
Jay Sage Problem With Tabbed Toolbar Support 1
S "Tabbed Toolbar" doesn't seem to work Support 16
Jay Sage Version 12: No Option to Configure Toolbar Support 2
williamleara Can't Close TakeCommand After Adding 2nd Toolbar Tab Support 3
D Dynamicaly configuring the toolbar Support 4
R Toolbar - save to .INI Support 4
G Display setting for Tabbed Toolbar Support 1
Phileosophos Toolbar Buttons Disappear Support 1
Jay Sage Toolbar Problem with Reloading from INI Support 0
Jay Sage Issue With Reloading Toolbar From INI File Support 0
Jay Sage Issue With Adding Buttons to Toolbar in Build 30 Support 0
P Toolbar configuration anomaly Support 5
Jay Sage TCMD11 Toolbar Issues Support 2
J V10 "Configure tab toolbar" issues Support 3
A Cannot permanently remove Tabs toolbar using View menu - bug? Support 8
O Problems opening an app in a tab from the toolbar Support 28

Similar threads