Monday, November 08, 2010 at 12:02 AM.
system.verbs.builtins.Frontier.clickers.typeTEXT
on typeTEXT (path) { //Open a file of type TEXT in a wp-text window
<<Changes
<<11/6/05; 7:52:06 AM by DW
<<On the Mac, if the file name ends in .opml, open it as an OPML file.
<<12/15/00; 7:12:05 PM by PBS
<<When a text file has been double-clicked in the Finder, call Radio's standard file opening script.
<<Wed, Oct 15, 1997 at 3:31:20 PM by PBS
<<Created.
if system.environment.isMac { //11/6/05; 7:52:06 AM by DW
if string.lower (path) endswith ".opml" {
return (Frontier.clickers.typeOPML (path))}};
local (s, adr, w = file.fileFromPath (path), tw, pw);
if defined ([path]) {
<<Don't try to re-open the file if it's already open.
<<Sat, May 23, 1998 at 2:57:30 PM by PBS
window.bringToFront (path);
return (true)};
if fatPages.fileIsFat (path) { //is this a fat page?
return (Frontier.clickers.typeFATP (path))};
if system.environment.isPike {
Frontier.finderToFront = false;
<<return (pike.commands.open (path))
return (Frontier.tools.windowTypes.commands.open (path))};
s = string (file.readWholeFile (path));
s = string.replaceall (s, cr + lf, cr);
s = string.replaceAll (s, lf, cr);
wp.newTextObject (s, @tw);
pack (tw, @tw);
unpackWindow (@tw, path);
window.open (@[path]);
window.setTitle (@[path], w);
frontier.finderToFront = false;
wp.go (up, infinity);
return (true)}
This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.