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


on makeWindow (path, wtype, adrwindow) { <<build a FinderWindowType parameter from the path
	<<For compatibility.  Not used directly in most scripts...used indirectly with old scripts or
		<<scripts not using the Scriptable Finder
	<<make one of these:
		<<finderWindowRec = RECORD
			<<windowType : LongInt;
			<<aliasType : DescType; { set to typeAlias }
			<<aliasLength : LongInt;  { set to length of alias record }
			<<alias : aliasRecord;
	local (file, wdata);
	if wtype == 0 { <<zero is main window; path must be to a folder
		if not file.isfolder (path) { <<non-folders can't have their own window
			scripterror ("This verb operates on a Finder window; the path must be to a folder");
			return (false)}};
	file = alias (path);
	wdata = binary (wtype); <<zero is main window for folder; 11 is Info; 13 is Sharing
	wdata = wdata + typeOf (file) + sizeof (file);
	adrwindow^ = wdata + file;
	setbinarytype (adrwindow, 'fwin');
	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.