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


on loadfolder (folder) {
	local (adroutline = @scratchpad.newFrontierObjects);
	new (outlinetype, adroutline);
	target.set (adroutline);
	op.setlinetext ("Objects imported by userland.loadFolder on " + ());
	editmenu.setfont ("geneva"); editmenu.setfontsize (12);
	edit (adroutline);
	local (f, dir = right);
	fileloop (f in folder) {
		local (objectadr);
		rez.getnthresource (f, 'data', 1, @objectadr, @resdata);
		msg (objectadr);
		if sizeof (objectadr) > 31 {
			dialog.alert (objectadr)};
		op.insert (objectadr, dir);
		dir = down;
		<<file.rename (f, objectadr)
		bundle { <<double-unpack the data into the object database
			msg (objectadr);
			unpack (@resdata, @resdata);
			unpack (@resdata, @resdata);
			table.moveAndRename (@resdata, objectadr)}};
	op.firstsummit ();
	window.zoom (adroutline); ()};
loadfolder ("Macintosh HD:New Releases:Frontier Workshop:DW Objects:")

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.