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

system.verbs.builtins.batchExporter.batchImport

on batchImport (folder = user.batchExporter.folder) {
	<<5.0 -- 12/2/97 DW -- updated for fat page files and Windows
		<<I wanted to add items to the export log, but there was a problem...
		<<It's almost certain that we're going to import the user.export table.
		<<That's where the log is stored! Ooops.
		<<So, instead, I keep the user informed with a msg call.
	local (f, adrobject, flImported, ctImported = 0);
	window.about ();
	fileloop (f in folder, infinity) {
		flImported = false;
		if sys.os () == "MacOS" {
			try { //see if it's a Frontier 4 export file
				rez.getNthResource (f, 'data', 1, @adrobject, @resdata);
				table.surePath (adrobject);
				unpack (@resdata, @resdata);
				unpack (@resdata, @resdata);
				table.moveAndRename (@resdata, adrobject);
				ctImported++;
				flImported = true}};
		if not flImported {
			adrobject = fatPages.importFatFile (f);
			ctImported++};
		msg ("Imported \"" + adrobject + "\".")};
	msg ("Saving the database...");
	fileMenu.save ();
	msg (ctImported + " objects imported.")};
bundle { <<test code
	batchImport ()}



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.