Making a custom User Tool
User tools are a convenient way to quickly access external tools or other applications. In an earlier post, we shared how to implement several Version Control systems in Understand. If you use a different version control system, or want to launch another application, you’ll need to know how to make your own user tools.
Launch an External Application
For example, suppose I want to open the current file in Notepad. First select Tools | Configure User Tools
Enter the name you want to appear for your tool, and the executable that is being launched:
The parameters section is a little more tricky. What you enter here will vary wildly based on what application you are launching. If you look at the arrow on the right of the parameters checkbox, you will see a list of variables that Understand can pass to another application.
In this case we want to pass Notepad the name of the current file, so we select $CurFile
If the application needs a working directory specified, you can set that, and if you would like to specify an icon for the tool, you can select something different than the application. These settings aren’t needed for this tool, so I leave them alone. Likewise there is no command line output and this is not an STI Perl script, so I’ll leave those checkboxes blank.
Finally we need to decide where we want the tool to appear inside of Understand. There are several option.
|Pop up Menu
Appears anywhere you right click
Appears under Tools | User Tools
Appears in the User Tools Toolbar
This tool will now open the current file in Notepad. Here are the complete settings.
Here are a couple more examples of some basic tools.
Launch Build System
In this sample I want to launch my Make script. Note the parameter. In this case I don’t want to send it a file name, I want it to ask me what to build. The $Prompt parameters will ask you for input. When I run this tool, it will ask me for my build target, which is what I wanted
Then the build output displays in the Understand command window. The great part of building in Understand is that if there are errors, you can simply click on the error message and Understand will jump straight to that line of code in the editor
In this sample, I want to lookup the selected text in MSDN’s library. There are many different ways to do this, but I think I’ll launch firefox with the following parameters:
This will search for the current highlighted text with Google on the MSDN site and the support site.