Monday, November 08, 2010 at 12:06 AM.


on launch () {
		<<10/31/07; 9:35:51 AM by DW
			<<Call webbrowser.launchMacBrowser first. If it can't launch a browser, fall through to the broken code (it really is a mess).
		<<1/9/02; 12:05:13 PM by PBS
			<<Must use actual codes because on OS X the app IDs may be '    ' since apps are bundles (folders) sometimes.
	local (id);
	if webBrowser.isRunning () {
		return (user.webBrowser.currentid )}; // a supported browser is already running.
	id = webBrowser.getDefaultBrowser ();
	if (id == false) or (id == 'NONE') {
		return (false)};
	case sys.os () {
		"MacOS" {
			if webbrowser.launchMacBrowser () { //10/31/07; 9:35:23 AM by DW
			if sys.appIsRunning (id) {
			case id {
				'MOZZ'; {
					if app.start (@Netscape) {
						user.webBrowser.currentid =;
						webBrowser.bringToFront ();
						return (id)}};
				'MSIE'; {
					if app.start (@msExplorer) {
						user.webBrowser.currentid =;
						webBrowser.bringToFront ();
						return (id)}}};
			scriptError ("Can't launch the web browser. Please check your preference with Internet Config.")};
		"WinNT" {
			if sys.appIsRunning (file.fileFromPath (id)) {
				return (file.fileFromPath (id))};
			if launch.appWithDocument (id, "") {
				user.webBrowser.currentid = file.fileFromPath (id);
				clock.waitSeconds (2);
				return (file.fileFromPath (id))}}}}

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.