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

on isEnabled (f) {
	<<Return true if a Tool is enabled, false otherwise. Tools are disabled when:
		<<1. There is a top-level item in the gdb named #enabled.
		<<2. #enabled is false.
		<<01/05/01; 5:12:27 PM by PBS
		<<10/7/01; 8:34:11 PM by JES
			<<Respect the flEnabled flag in the tool's user table.
	local (flEnabled = true);
	if not (file.exists (f)) { //it's an error if the Tool doesn't exist
		scriptError ("Can't determine if " + file.FileFromPath (f) + " is enabled because it doesn't exist.")};
	on checkBoolean () {
		local (toolName = (file.fileFromPath (f)));
		if defined ([toolName]) {
			if not defined ([toolName].flEnabled) {[toolName].flEnabled = true};
			if not[toolName].flEnabled {
				return (false)}};
		if defined ([f].["#enabled"]) {
			if not ([f].["#enabled"]) {
				if defined ([toolName]) {[toolName].flEnabled = false};
				return (false)}};
		return (true)};
	if not defined ([f]) { //is the gdb open? (f, true); //open hidden
		flEnabled = checkBoolean ();
		if not flEnabled {
			fileMenu.close (f)}} //close it, it's not enabled
	else {
		flEnabled = checkBoolean ()};
	return (flEnabled)}

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.