| ||||||||
|
Cool Mac Gear iPod Video iPod nano iPod 1G-2G iPod 3G iPod 4G iPod Mini PowerBook-iBook Garageband |
As regular Applelinks readers know, I am a big fan of Tex Edit Plus, Tom Bender's powerful and versatile little shareware text editor. I use Tex Edit Plus for drafting articles and correspondence, for cleaning up text from emails and downloaded from the Web, and for converting text documents to HTML for Web publishing. All of these tasks are facilitated and streamlined by Tex Edit Plus's superb implementation of AppleScript, the slickest and best at this of any program I've used. Tex Edit Plus's AppleScript configuration could hardly be smoother or more user-friendly. Scripts, which, if you're not familiar with AppleScript, are sort of mini-applets that automate a particular function, are stored in a folder called "Scripts" in the Tex Edit Plus application folder, and appear in an AppleScript menu when Tex Edit is running. When you add new scripts to the folder, they show up in the menu instantly without your having to restart the program. To run a script, you just open the menu and click on a selected script title. Even better, for scripts that you really use a lot, it is more convenient to assign keystroke shortcuts to activate them, which is done by simply adding the key(s)' name to the script's name with a slash -- for example: with the script Mac -> HTML/F6, press the F6 key and a copy of your document gets converted to html while you watch. A couple of dozen or so AppleScripts are bundled with the Tex Edit Plus standard download, and because Tex Edit Plus is recordable, you can record custom scripts of your own to automate tedious or frequently repeated tasks using the Apple Script Editor utility that is included with the Mac OS. The scripts I use most often with Tex Edit Plus relate to things like converting text from/to lower/upper case, capitalization (yes, I know there are submenu commands in Tex Edit Plus that can do this too, but an AppleScript with a single keystroke shortcut is faster and slicker), and HTML markup. I prefer to create HTML documents from scratch, and as I work, rather than using a WYSIWYG Web page authoring application, but I am not enchanted with typing a lot of tedious little HTML tags. Now, Bare Bones Software's BB Edit is a superb tool for doing this sort of HTML markup. But for my purposes it has always seemed like overkill. My HTML authoring needs are not complex, but if yours are, definitely check out BB Edit. On the other hand, BB Edit sells for $99, and Tex Edit Plus sells for just $15 and has the aforementioned streamlined and convenient AppleScriptability. Basically, AppleScript allows me to add just the HTML markup capability I need and want without a lot of other selections that I never use and which just get in the way. Here is how I develop an HTML page for Applelinks. First I need the text. Columns and reviews are written mostly from scratch, while news briefs may include a fair bit of pasted in text from press releases and such. I usually rough out my articles longhand on paper and then dictate them into a Tex Edit Plus using iListen, or by way of ViaVoice. Pasted in URLs and e-mail addresses are then added, and the article proofread and spellchecked to remove (not always 100 percent successfully, alas) those pesky, perfectly spelled, non-sequitur typos peculiar to dictation software. Once the article is finished the writing and initial proofing, I want to convert it to plain, black, 12 point size, text, so I select my "Styleset" AppleScript, which looks like this:
I use the Comic Sans font as a good, readable, screen font, but it gets converted to a generic, monospace font anyway in the next step. That next step and he is to convert the document to basic HTML. The tool that I use for this is the Mac -> HTML/F6 script which comes bundled with Tex Edit Plus. This script is based on: Script2HTML 1.0.2 by Bill Cheeseman, and the latest version of Bill's script is available at The AppleScript Sourcebook: http://www.applescriptsourcebook.com/frames.html. The conversion process takes a few seconds, and results in a copy of the original document in simple HTML form, leaving the original draft untouched. There are several other AppleScripts that will convert text to html, some that do a fancier job, but for my purposes I'm better off with the simpler one. The Mac -> HTML/F6 script converts all hard returns to paragraph (<p>) tags, and a many cases what I really want is just a line break, so this little script called " to
If I just want to create a line break where there isn't one, I use this "Insert Break" script:
Plain bullets aren't handled gracefully by Web browsers, so the next step is to convert bullets to "•" HTML Tags using this script:
Most browsers can handle standard ("stupified" as opposed to "smart") quotation marks, but just to be sure, I run this script to convert quotes to html tags:
To turn URLs and e-mail addresses into clickable Web links, I then apply the appropriate one of these two scripts:
Or if I want to convert a piece of text to a clickable web link, I use the Selection->Link script by Andrew Sasaki, which is downloadable from Doug Adams' Tex Edit Applescript archive, where you can find more than 200 free, downloadable AppleScripts. Most of the ones mentioned in this article, including my own little batch of recorded scripts called "HTML Suite," can be found on that site. The Selection->Link script takes a text selection in Tex-Edit Plus and makes it into a web link. It's smart enough to handle URLs and plain text differently. For many articles, that completes the HTML markup stage, but often there are other formatting jobs to add, such as blockquoted blocks of text:
Bold for headings or emphasis:
Bold plus a point size boost for even more emphasis:
Centering blocks of text or tables:
Or the blue font color I use in Mailbag columns to distinguish my replies from readers' letters:
I also have a couple of scripts that create clickable text references and target couples within a Web page, such as jumping from a Table of Contents entry to the subhead for that topic in the column or article:
Other useful AppleScripts I downloaded from Doug Adams' Website color all HTML tags in a document making it easier to proof read, or create HTML tables. Jerome Koons' Create HTML Table makes an HTML table using user-supplied variables. It can be used in conjunction with the "Create Anchor Refs" script to place anchor references in the table. When a markup is all done, the result is a document that when named with a html suffix can be opened with a Web browser as a formatted page -- essentially it is a Web page. For Applelinks articles I then copy the title and body text of the document and paste them into a template that adds the Applelinks Web page formatting, links, and graphics, and then copy and paste that into a CGI posting engine using a browser. This system works well for me, and gives me more precise control of the appearance of an article, and generates very clean text copy which is relatively easy to proofread and modify. The AppleScripts described here do what I need to get done in HTML, but of course pretty much any HTML markup or text formatting function can be recorded and automated as Apple script. A few other scripts I use for editing text: select all - selects contents of open window
Casecap - capitalizes selection
Caselow - lowercases selection
Caseup - uppercases selection
You can copy the syntax of the simple scripts shown here using Script Editor, or download them (and many others) from Doug Adams's site here: You can download Tex Edit Plus ($15.00 shareware) here:
Page: 1 - 2 - 3 - 4 - 5 |
| ||||||
|
| ||||||||