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


on typeosas (path) {
	<<open a file of type osas, an AppleScript Script Editor file containing an OSA script
	local (resdata, adr);
	if not rez.getResource (path, scriptType, 128, @resdata) {
		scriptError ("Can't open script in file \"" + file.fileFromPath (path) + "\".")};
	if Frontier.isRuntime () { <<just run the script
		return (resdata ())};
	adr = @system.deskscripts.[file.fileFromPath (path)];
	osa.getSource (@resdata, adr);
	delete (@resdata);
	export.lastfolder = file.folderFromPath (path); <<set default for script export
	system.deskscripts.path = path; <<make path available for debugging
	Frontier.bringToFront ();
	Frontier.findertofront = false;
	return (edit (adr))}

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.