A powerful new connection! -- Now you can use BBEdit 4.0 to edit string and text cells in Frontier's object database.
By Dave Winer, firstname.lastname@example.org, 6/27/96
The ODB Text Editor suite implements an open protocol defined by BBEdit 4.0, allowing it to be used to edit string and wptext objects that are stored in Frontier's object database.
This gives you full advantage of both software products. The text of Frontier's object oriented websites are now editable by BBEdit. This plugs in well with storage system improvements coming in Frontier 4.1, which rely on disk-based strings to store HTML text more efficiently.
This is an open protocol. Bare Bones and UserLand encourage other editing tools and database vendors to wire up. The scripts in the suites.odbTextEditor table define the protocol. The source code is there. Let's have fun!
By the way, I am editing this page in BBEdit 4.0, but it's stored in the Frontier object database.
How to Install and Use
Download the package from:
The folder contains two items, the suite that implements Frontier's side of the protocol and a new command for Frontier's menu bar.
- Double-click on the files in the Finder, click on OK for all confirmation dialogs that appear.
- There's a new command in the UserLand menu, Edit Object Text, single keystroke cmd-E.
- Open a table containing a string or wptext object, put the cursor on the object and press cmd-E.
- A dialog appears asking you to locate a compatible editor. For now, that must be BBEdit 4.0 or greater. Choose the app, click on OK. The editor launches and opens the text of the object you chose to edit. The next time you run the command you will not be asked to locate the editor.
- Now, you're in your editor. Make some changes. Cmd-S to save. Switch back into Frontier and check it out. The object you chose to edit has changed!
Is that cool? Yes!! Very.
How it works
First, thanks to Rich Siegel and Bare Bones Software for designing this protocol. It's very low tech, and very nice. To see the details, check out suites.odbTextEditor.editText. Here's the overview.
- adrobject contains the address of the object to be edited.
- First, we make sure that the user.odbTextEditor table exists and that its fields are initialized.
- If the editorApp isn't running, launch it and clear out the user.odbTextEditor.openfiles table. Bring the editor app to the front.
- Create a temporary file in the Preferences folder containing the text of the object. Associate the file spec with the address of the object in the openfiles table.
- Create a traps table for the editor app if it doesn't exist. Copy two Apple Event handler scripts into the table. These scripts will be called when the editor app saves the file or closes the window.
- Send a special version of the required.openDocument verb to the editor app, including the ID of the app to be notified when a file is saved or a window closes. The ID is 'LAND', the creator ID of Frontier.
- When a file is saved, we copy the contents of the file into the cell in the object db. When a file is closed we delete its entry in the openfiles table.
A fix is coming in the next release of BBEdit so the protocol will work when the user does a Save As.
The protocol is not two-way. If you switch into Frontier and edit the text there, your changes will not be reflected in BBEdit's version of the text. So if you're going to edit in Frontier, close the window in BBEdit first.
The filespec for the editorApp is stored at user.odbTextEditor.editorApp. If you want to change the app, delete that cell. You'll get a chance to choose a different app next time you edit something.
The Edit Object Text command will be inserted at the end of the UserLand menu. You may want to use Frontier's menu bar editor to move it to after the Jump To Cell command, a more natural location for this command.
Imagine a pipe starting with BBEdit and connecting to WebStar and via FTP to Unix and Windows servers. This is one end of the pipe. We're also working with Chuck Shotton, and should have an announcement and a new software release next week.
As with all the new connections we're developing in conjunction with other Mac developers, this capability has no counterpart on other platforms. The combination of BBEdit's editing power and Frontier's object storage and scripting power are unique to the Mac.
If you know people at Acius, Blyth, Apple, Adobe, Microsoft and Claris, point them to this page and tell them that you'd like this stuff to work with 4D, Omnis, HyperCard, PageMill, Front Page and Home Page.
The About this Website page for the DaveNet website introduces the website building features in Frontier 4.0 and points to other pages and websites with more information.