LogMeTT.com • ButtonBar
Page 1 of 2


Posted: Tue Feb 05, 2013 11:57 pm
by IshmaelCallMe
Need GUI Function Buttons for Putty, TeraTERM, cmd, or extra ones for SecureCRT to automatically type in commonly used commands? Well, since these were not there before (particularly for my personal favorite TeraTERM), I decided to write my own add-on. Run this program, and the button window will “dock” onto the bottom (or top, if no room on bottom) of the most recently active window of the above types.

Nice thing about this one is that all button information is stored in the INI file, so you can easily port (or back up) your pre-defined buttons to different windows hosts. Right click on any button to edit or move it. There is also a windows tray (bottom right of screen) icon that you can click on with several features.

You can make a shortcut (or .bat file) with a ini file name as a command line argument if you wish to start it with a different ini file. You can use the “IniSelect” button type (when creating a new button) to change the ini file being used with just a single button click, so you can have as many sets of instantly-accessible buttons as you wish.

If you keep adding buttons, the window will get wider until it passes the maxwidth parameter defined in the ini file. It will then start another row of buttons. No limit to the number of rows or total number of buttons.

This is similar to my old function button viewtopic.php?f=13&t=789, but much better. This creates a second window that automatically "Docks" to the active TeraTERM or SecureCRT window. This can co-exist with the Collector application if you configure the collector bar to be on the side. I think this is good and useful enough to possibly be included in the distribution. What do you think, Boris?

You need to install AutoIt.

Looks like I am running up against the 60K char limit. Latest version is now attached to this first post as a downloadable ZIP file.

Put files in the same directory. Now, either compile the script to a exe, or just run the script with AutoIt.

Re: ButtonBar

Posted: Wed Feb 06, 2013 12:09 am
by boris
Yes, it looks useful, but it's not me who decides what goes into the distribution :oops: .

Yutaka: What are your thoughts about this proposal?

Re: ButtonBar

Posted: Thu Feb 14, 2013 1:23 am
by IshmaelCallMe
Updated with a MUCH more sophisticated version that allows configuration by right-clicking on the buttons. Enjoy!

Re: ButtonBar

Posted: Tue Feb 19, 2013 3:48 pm
by IshmaelCallMe
Updated again for multiple button rows, ini selection button type. This should be the more-or-less final version. (Yeah, right, like when is any program totally finished)

Re: ButtonBar

Posted: Tue Mar 05, 2013 4:52 pm
by IshmaelCallMe
I was right, it wasn't done. Updated again for a bunch of new features (self explanatory from menus, etc). Explore and enjoy!

Re: ButtonBar

Posted: Thu Mar 14, 2013 5:10 pm
by IshmaelCallMe
Updated again for bug fix, more features and functions. You can now set a key for changing the ini file for a single use. This allows you to have other "sets" of buttons that you can call and will then revert to the base set.

Please let me know if you find this program useful.

Re: ButtonBar

Posted: Thu May 09, 2013 2:48 pm
by IshmaelCallMe
Update again to V1.22 for better window handling, bug fixes, new features. Will also now work on Putty and windows cmd windows.

Re: ButtonBar

Posted: Mon Sep 02, 2013 9:48 pm
by TimmyD

This program is very useful to me. I was using another program for repeated commands in Tera Term.

Your program is much better!!

Thanks for taking the time to create it!

Best Regards...

Re: ButtonBar

Posted: Tue Oct 22, 2013 2:29 pm
by IshmaelCallMe
Another update to V1.31 with new features including button prototypes and multi-line buttons.

Good to hear that people find it useful. Keep it coming.

Re: ButtonBar

Posted: Fri Jan 03, 2014 4:33 pm
by blackhawk1793
Hello IshmaelCallMe and fellow members of LogmeTT, :smile:

I'm having bit of trouble using your script.

I've executed the ButtonBar.au3 and an error message appears:
Fig 1 - Popup error while executing ButtonBar.au3
Error1_.jpg (30.05 KiB) Viewed 8759 times

I've placed both files in same directory within personal documents folders, replaced ligne 11 of ButtonBar.au3 with the file location of ButtonBar.au3 (C:\Users\xxxxxxxx\Documents\IT\SCRIPTS\Teraterm\ButtonBar\ButtonBar.au3). And i just execute the buttonbar.au3.

At first i tried this script with TeraTerm 4.77 already launched. Then downloaded latest TeraTerm version and still got the same error.

Could it be that your code was messed up while posting to forum, sneaky smileys inserted them self. :o
Here is ligne 583 of ButtonBar.au3:

Code: Select all

  2. If StringLeft($inirs[$k][0], <!-- s8) --><img src=\"{SMILIES_PATH}/sunglasses.gif\" alt=\"8)\" title=\"Cool\" /><!-- s8) --> == 'Command_' Then

I may not have the right prerequisites:
Tera Term: 4.80 (SVN# 5451)
AutoIt: v3
Win7 x64 Pro

Please continue working on this wonderful macro script. It's just what i need.

Best regards,

Re: ButtonBar

Posted: Fri Jan 03, 2014 8:57 pm
by IshmaelCallMe
It was indeed invaded by a rogue smiley. I didn't know they were that aggressive!

I put in a updated version that again is much improved (1.42 vs 1.31 that was there before)

Latest version in first post.

Re: ButtonBar

Posted: Fri Jan 03, 2014 9:27 pm
by IshmaelCallMe

Re: ButtonBar

Posted: Sat Jan 04, 2014 5:59 pm
by blackhawk1793
Thank you very much for the update. Everything is working just fine.
I was amazed how well done this addon is, it even works with windows cmd terminal :satisfied:

What is "IniSelect" and "IniSelect Signle use" that can be seen under "Edit and Create New button" -> "Type of button" used for? Why have you implemented this feature?

I would like to add an "X" on the exit button and a "+" on the "Create new button", how can this be done? This could make it a little more intuitive instead of having to wait for a tooltip.

Again thanks for the good work!!
Keep it coming!!


Re: ButtonBar

Posted: Mon Jan 06, 2014 4:56 pm
by IshmaelCallMe
Always nice to know it is appreciated.

I do have a couple of ico files that have the X and +. The BBS does not let me attach them, though. Not sure how I could get them to you.

The ini select functions allow you to load a different set of buttons by changing the ini file. Singleuse will only keep the new set loaded for one button press. This allows you to have several sets of buttons, selected from a base master menu set of buttons.

Hope you find it useful. I personally use the heck out of it , every day.

Re: ButtonBar

Posted: Mon Jan 06, 2014 9:27 pm
by boris
IshmaelCallMe: You can archive images and attach them to your post as ZIP file.

Re: ButtonBar

Posted: Tue Jan 07, 2014 4:32 pm
by IshmaelCallMe
Thanks, Boris. That worked. I attached a zip file with the icons to the first post. Note that you will have to compile the script to an exe (using the special version of SCITE from the AutoIt project) in order to get these to show up since I use a resource section in the exe to store them. One could also modify the script a little bit (really easy) to get the icons to show up, I will leave this as an exercise for the student.

I also wrote a simple installer. Compile this in the same directory, and it will make a buttonbar_install.exe that will automatically install it, set up start files, etc.

Code: Select all

  1. #RequireAdmin
  2. $list = ProcessList("ButtonBar.exe")
  3. For $i = 1 To $list[0][0]
  4.     ProcessClose($list[$i][1])
  5. SplashTextOn('Please Wait', 'ButtonBar is now installing to C:\Program Files\TT_Scripts', 500, 70)
  6. If Not DirCreate(@ProgramsCommonDir & '\ButtonBar') Then MsgBox(0, 'ERROR', 'Could not create ' & @ProgramsCommonDir & '\ButtonBar')
  7. If Not FileCreateShortcut('C:\Program Files\TT_Scripts\ButtonBar.exe', @ProgramsCommonDir & '\ButtonBar\ButtonBar.lnk', 'C:\Program Files\TT_Scripts') Then MsgBox(0, 'ERROR', 'Could not create ' & @ProgramsCommonDir & '\ButtonBar\ButtonBar.lnk')
  8. FileCreateShortcut('C:\Program Files\TT_Scripts\ButtonBar.exe', @ProgramsCommonDir & '\ButtonBar\Uninstall_ButtonBar.lnk', 'C:\Program Files\TT_Scripts','--uninstall')
  9. If Not DirCreate('C:\Program Files\TT_Scripts\') Then MsgBox(0, 'ERROR', 'Could not create ' & 'C:\Program Files\TT_Scripts\')
  10. If Not FileInstall('ButtonBar.exe', 'C:\Program Files\TT_Scripts\', 1) Then MsgBox(0, 'ERROR', 'File Install for ButtonBar.exe failed');overwrite
  11. FileInstall('Demo_ButtonBar.ini', 'C:\Program Files\TT_Scripts\ButtonBar.ini', 0) ;do not overwrite
  12. FileInstall('Demo_ButtonBar2.ini', 'C:\Program Files\TT_Scripts\ButtonBar2.ini', 0) ;do not overwrite
  13. If Not DirCreate(@AppDataDir & '\Microsoft\Internet Explorer\Quick Launch') Then MsgBox(0, 'ERROR', 'Could not create ' & @AppDataDir & '\Microsoft\Internet Explorer\Quick Launch')
  14. FileCreateShortcut('C:\Program Files\TT_Scripts\ButtonBar.exe', @AppDataDir & '\Microsoft\Internet Explorer\Quick Launch\ButtonBar.lnk', 'C:\Program Files\TT_Scripts')
  15. FileCreateShortcut('C:\Program Files\TT_Scripts\ButtonBar.exe', @StartupCommonDir & '\ButtonBar.lnk', 'C:\Program Files\TT_Scripts')
  16. ;_TaskToolbarWin7("Shell:Quick Launch")
  17. MsgBox(0, "Congratulations!", 'ButtonBar Installation to C:\Program Files\TT_Scripts\ButtonBar Complete')
  18. ShellExecute(@AppDataDir & '\Microsoft\Internet Explorer\Quick Launch\ButtonBar.lnk')
  20. Func _TaskToolbarWin7($path) ;Add quick launch folder to taskbar
  21.     $title = "New Toolbar - Choose a folder"
  22.     MouseClick("right", 0, @DesktopHeight)
  23.     Send("{DOWN}{RIGHT}{UP}{ENTER}")
  24.     WinActive($title)
  25.     Sleep(1000)
  26.     ControlSetText($title, "", "Edit1", $path)
  27.     Sleep(1000)
  28.     ControlClick($title, "", "Button1")
  29. EndFunc   ;==>_TaskToolbarWin7

Re: ButtonBar

Posted: Thu Jan 23, 2014 8:13 pm
by blackhawk1793

Here is an example of how your ButtonBar interface is used.

I perform hardware tests on network appliances (switches, routers, firewalls...). To perform these tasks, serial ports are used to communicate with the devices. I use a USB to DB9 RS232 Serial Adapter Hub (4 ports), then i open 4 terminal windows on one of my screens. Then I load ButtonBar, which places it self on an active terminal/shell window.

Here you can see what this looks like:


So i basicly plug in a COM cable from the hub to a console port on a network device, and power on the device. The unit will output text and stuff on one of the terminal windows. From this point i enter in a config menu, upload a test firmware to the device, run it and it tests the unit.

We follow a process where user must execute multiple commands. For example, we perform "Get sys stat" that retrieves system info, then we start the test; "diagnose hqip start". Once the test finished, we format the device's storage with "execute format ...", then execute reboot "execute reboot" or power off depending on what the results of the test are.

Many commands ask for user input like "yes, no, ...", so this ButtonBar has come in handy, it's like having mini macros, they execute the command, answer yes to any eventual question and your done. No need to abuse the keyboard and fingers. I just click on different buttons at different stages.

Now because I test multiple device at the same time, some devices ask for user input at different times, so i just monitor the screen until one need a input, click the window and ButtonBar jumps to the window selected, then i click the appropriate button.

There is on things to note, when you click on a button, it will execute the command you configured it to type in the terminal window. I sometimes apply 1 seconds pauses to make sure it properly works, this is because some devices that longer than others to respond to a command. So i you can imagine, when clicking on one the buttons, it execute a first command, waits 1 second, then enter "y", then sends "enter". All this takes about 2 seconds in total.
Here is when the problem occurs, if I click on another window in mean time, the ButtonBar jumps to the window I clicked and continues executing the commands. So you need to wait for all the commands to be sent before you click on another window.

I tend to click on another window too soon, and see the stuff it was supposed to type in another window; like half here and half there. This kinda fucks things up little.
It would have been cool to be able to force the ButtonBar to finish executing the commands before it jumps to another windows, so that it does muck things up.
Or make ButtonBar make a button bar on each window/terminal/shell :o

Now I'm told it could eventually be possible to completely automise to whole process, but where not there yet. In the mean time, it's already great to be able to gain a few seconds now and there by saving some typing to do.

Anyway, just wanted to share how I use your ButtonBar. :wink:

Thanks for this,
Best regards,

Re: ButtonBar

Posted: Fri Jan 24, 2014 6:46 pm
by IshmaelCallMe
Cool, love to hear how people are using it.

I fixed that problem and put the new script into the previous posts. It will now actually switch the active window back if it needs to so that the commands are not split if the active window is changed.

That said, it sounds like your application could be completely automated by the TeraTERM scripting language. I would recommend looking into that, since I really don't want to re-invent a wheel by having a buttonbar scripting language. 1 second pause is a far as I am going to go! :)

You could then use the "MacroRun" buttonbar button type to start the TeraTERM script.

Re: ButtonBar

Posted: Thu Aug 07, 2014 3:50 pm
by IshmaelCallMe
V 1.52

Re: ButtonBar

Posted: Thu Aug 07, 2014 3:51 pm
by IshmaelCallMe
V 1.52

Re: ButtonBar

Posted: Tue Oct 14, 2014 10:03 pm
by IshmaelCallMe
Updated first post with latest version 1.62

Re: ButtonBar

Posted: Wed Jan 21, 2015 12:04 am
by IshmaelCallMe
Newest version 1.67 now attached to first post.

Re: ButtonBar

Posted: Thu Mar 12, 2015 3:45 pm
by IshmaelCallMe
Newest version 1.75 now attached to first post. Much more stable, new features.

Re: ButtonBar

Posted: Sun May 10, 2015 1:01 am
by TimmyD
Hi IshmaelCallMe,

Thanks so much for continuing to update ButtonBar. I use it all the time.

I am having a small issue with it in Windows 8. After I open Tera Term, and then run the script it works without issue. Then if I close Tera Term, and leave the script running, then reopen Tera Term the button bar does not appear. I downloaded the version 1.75, and have the same behavior.

In windows 7 this does not occur. As long as the script is running it always works when Tera Term is closed and reopened.

Any ideas? Thanks in advance!!

Best Regards,

Re: ButtonBar

Posted: Mon May 11, 2015 1:45 pm
by IshmaelCallMe
Glad to hear it is useful. My company still uses win 7 on almost everything, so I don't have much experience with ButtonBar on win 8 (although I have tried it and it seemed to work). In your case, is the program still running even though the buttons don't show up? IE, is there still an active tray icon?