TruerWords Logo

Search TruerWords

Sign Up  Log On

Patching Frontier's Support for External Editors

Patching Frontier's Support for External Editors

Please note that this information is equally as applicable to Radio as it is to Frontier.

As has been mentioned, MacOS X 10.2.2 changed something related to the sending of Apple Events. Unfortunately Frontier has not yet been updated to deal with this change, and crashes under some circumstances.

The AE I use the most in Frontier is the one sent when you type Command-E after selecting a string or WPText object in the database. This opens the object as a text file in BBEdit. Edit this file, and whenever you save it the changes are immediately loaded back into the original object in Frontier.

With the changes in 10.2.2, Frontier crashes when you try to edit its text in BBEdit, and so I've written a workaround that's perfectly functional and very easy to do. Instead of sending the AppleEvent from a UserTalk script, we'll send it with an AppleScript living in Frontier.

Create an AppleScript in Frontier

In Frontier, jump to suites.odbEditor.editors.Text. Create a new script, and call it "editAE". After the script window opens, use the popup menu at the bottom to change the language from UserTalk to AppleScript.

Now copy the following script and paste it into the script's window, then delete the blank line at the top. If you're using a different version of BBEdit, or a different text editor that supports this same feature (Style, Tex-Edit Plus, or PageSpinner), then replace "BBEdit 6.5" with the exact name of whatever you're using.

on editae( f )
	local appId
	set appId to |db.get|( "" )
	tell application "BBEdit 6.5"
		open alias f given «property FSnd»:appId
	end tell
end editae

Compile the script by clicking the Compile button.

Change an Old Script to Call the New

Our last change is to modify the UserTalk script which normally sends the Apple Event to BBEdit, so that it will instead call our new AppleScript. This is a temporary change that we only need until UserLand updates Frontier to avoid the crash.

Open the script suites.odbEditor.editors.Text.edit. it's right there in the same table as our AppleScript script. Scroll down to the bottom, and look for this line:

bundle «send an Apple Event to the editor to open the temp file

Select that line, and type command-backslash to 'comment it out.' Now copy the following script and paste it in immediately after the line you just commented out:

bundle // use applescript to open file in BBEdit
	parentOf( this^ )^.editae( string( tempfile ) )

Click compile at the top of the script window, and you're done! External text editing is once again fully functional.

More Information

Since BareBones and UserLand first created the ODB Editor Suite, support for it has been added to various other applications. You can read more about it on where it's called external editor protocol. The official version of the ODB Editor Suite is hosted and maintained by BareBones.

Page last updated: 11/27/2002

is Seth Dillingham's
personal web site.
From now on, ending a sentence with a preposition is something up with which I will not put. - WC