Issue 84 * December 18 2009

tText for Revolution Users
A Text Editor Extensible via Simple Revolution-built Plugins

by Jerry Daniels

Back in 2007, I developed a simple text editor that featured tabs for its documents. Its purpose: to help me create quick snippets of HTML for my blog posts and comments. At the time I called it Zing-Ding.

Although we used Zing-Ding ourselves, we held off releasing it because we had no traction in the general text/HTML editing market. No one knew me or our little company. But, then an idea came flying in the kitchen window like a little bluebird. What if there was a text editor that was extensible via simple Revolution-built plugins? A text editor for Revolution Users. Now, there's a market where our products and our work are well known!

Now you know how tText was born, matured and got released. It's a simple text editor with which (thanks to its plugins) you can do most anything. All you need is a copy of tText and Revolution. tText costs only $12 USD and works well with any version of Rev, including Rev Media, the free one.

What can you do with tText and its plugins?

If you were crazy enough, you could create an entire development environment. But, alas, I am the only one crazy enough for such an undertaking, and even I have no such desire. What you can do, fast and easily, is parse text.

Many, many Revolution developers write little stacks to do a quick text parsing task. I've written at least fifty of them over the last 6 years. But keeping track of them and re-using them is a difficult undertaking for me, as I suspect it is for most of us. These days, I just create a tText plugin anytime I need to parse some text. Here's how you can do it, step-by-step.

1. Before opening tText, place it next to Revolution.

When I say "next to Revolution", that means "at the same directory level as the version of Revolution you'd like to use to make your plugin."

That may seem like a simple task, but you'd be surprised how many folks mistake the alias or shortcut to Revolution for the actual Revolution application. You will need to place tText at the same directory (folder) level as the Revolution application, not the shortcut or alias that points to the actual application.

There is a reason for this placement: we want you to be able to switch easily (without pesky dialogs) from tText to Revolution as you create your plugin and test it.

2. Open tText.

I like to place tText on my task bar or dock right next to Revolution. A single click and I'm ready to do anything I please with my text.

3. Open the Plugin Manager.

It's beneath the Plugins menu on the menu bar.

This little Plugin Manager dialog does a lot for such a low-profile window. It manages the separators and item-order in your Plugins menu, as well as allows you to create plugins, delete plugins, or draft an existing stack into service as a tText plugin.

4. Open a sample plugin in Revolution.

Click the Filter Emails plugin in the Plugin Manager list. Then, click the Open in Rev button. Presto! You're looking at a stack in Revolution that has an Edit button staring you in the face. Don't be shy, go ahead and click that Edit button.

Your script editor of choice (that could be tRev, you know) will open and display the script to the Filter Emails plugin. Whenever you choose a plugin from tText's Plugins menu, a doStartup message is sent to its corresponding plugin stack. The handler you are now viewing in your script editor is that doStartup handler.

The essence of tText coolness is to mess with a bunch of text in the Source field and, then, put the result of your munging into that same field under a new tab. The tText API call that opens a new tab is createNewTab.

So, to sum-up, your plugin gets called with doStartup, you take the text in the Source field, parse it or whatever, create a new tab with createNewTab, and then put your clean text into the new tab's Source field.

I think you get the idea. Now you can create a new plugin of your own.

5. Create a new Plugin

To do this, from inside the Plugin Manager click the New radio button and then click the Add button.

This will create a new plugin for you entitled "Untitled 1", and add it to your list—and thusly, to your Plugins menu once you close the Plugin Manager. You can also add separators between your plugins. Double-click any name in the list of plugins to rename it, btw. Menu item shortcuts are automatically assigned as you create your plugins.

You can drag and drop a plugin to any position on the Plugins menu via the Plugin Manager. The items of the menu get re-assigned shortcuts 1 to 9 after they are re-ordered via drag-and-drop. "Plugin Manager" is always the last item on the menu.

6. Open your new plugin in Revolution.

Once you have a new Plugin, select it in the manager's list and click Open in Rev. Then click the Edit button on the new plugin's stack.

In the script editor, you'll see the framework code for the plugin, all within the doStartup handler. Extensive comments are there for your convenience. Go ahead, write your first plugin. It's fun.

There's More Here Than Meets the Eye

I was only half joking earlier when I put myself forward as the only one crazy enough to create development environs reflexively. As I type, folks have already made tText plugins for use as color palettes, shell utilities, text-to-speech conversion, and so on – and most of these plugins are also posted for free download on our Rev Editor site. So I'm not the only crazy one. You might be, too!

Here's another thought: ever try explaining to a non-Rev person how easy it is to parse text in RevTalk? And, then, try to show them how? By the time you start coding, they're lost on the whole stack/card thing. Just think, with tText you can show the un-initiated how it's done within the context of a text editor and a simple plugin system.

A new user could get tText, download Rev Media, and start parsing their own text in minutes. This is a great thing for many, many IT workers and analysts working in cubicles all over the world. Think how many text dumps they need to filter or analyze. This is going constantly and there's been no easy solution...until now!

tText + Revolution = simple, easy, inexpensive system for munging your text and keeping track of your mungers.

----------------

Mentioned in this article...

Both tText and tRev are included in the MegaBundle... If you're not bundling-up between now and the end of the year, you should click here to purchase tText—and click here to purchase tRev.

About the Author

Jerry Daniels is one half of Daniel & Mara, and creator of tText and tRev.

Main Menu

What's New

Get the Megabundle 2009