Skip to content

The Command Launcher Part 4

Trevor Williams edited this page Apr 26, 2020 · 1 revision

Wrapping up our discussion of TKE’s command launcher utility, we are going to explore a few features that not essential for an editor but come in really handy when working on code.

Calculator

The command launcher is equipped with a built-in calculator that uses Tcl’s "expr" command. What that means is that not only can you perform basic calculations, but you can also tap into more complex equations using mathematic operators, parenthesis, and the like. To perform a calculation, simply start entering the expression in the command launcher. It will automatically determine if you are typing an equation and display the current calculated result in the results field. Hitting the RETURN key at any time will end the calculation and copy the result to the clipboard. The capabilities of Tcl expressions well exceed that of even the most feature-rich calculator applications, making this super useful when you need to do a quick calculation or need something more advanced.

URL Launcher and Bookmark

Ever find yourself working on code and need to reference some information from a website? Simply call up the command launcher, enter the URL of the website, hit RETURN, and TKE will automatically call up your browser with the given URL. Even better, TKE will also create a bookmark of this website meaning that the next time you want to visit the website, you only need to enter a fuzzy matched string of the URL and it will be displayed in the matched result list.

For example, say I need to access some information for the Tcl/Tk website. The first time I want to go to this website, I enter http://www.tcl.tk or even just www.tcl.tk. The next time I want to visit that website, I only need to enter a string like "tcl" and the URL will be displayed.

URI Launcher and Bookmark

If your system contains URIs, you can access them via the command launcher in the same way as URLs, only instead of launching a website, TKE will perform the URI command and remember it as a bookmark for future use.

As an example, on my Mac I use an application called Dash which contains a ton of reference material for various languages, so if I wanted to look up some information about Tcl’s string command, I can access this information by entering "dash://tcl:string" in the command launcher. This will automatically launch the Dash application, bring it to the foreground, and display the documentation for the Tcl string command.

Even better, the URI is automatically bookmarked so the next time I need information about Tcl’s string command, I can just enter something like "string" and the matching URI will be displayed in the search results.

Clone this wiki locally