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


on getObjectAdr (prompt) { <<prompt the user for the name of object to export
	local (name, tablename, objectname, quotedname);
	on suggestobjectname () { <<return an object db address for display in a dialog
		local (name);
		name = export.objectadr; <<default, suggest name of last item exported
		if !defined (name^) { <<don't suggest name of object that doesn't exist
			name = ""};
		wfront = window.frontmost ();
		if wfront == "" { <<no window open
			return (name)};
		if !defined (wfront^) { <<window doesn't contain an addressable object
			return (name)};
		if typeOf (wfront^) == tabletype { <<for tables, suggest selected item
			name = table.getCursor ();
			return (name)};
		return (wfront)};
	name = suggestobjectname ();
	if not dialog.ask (prompt, @name) {
		return (false)};
	adr = address (name);
	if not defined (adr^) {
		scriptError ("Can't export because there's no object named " + adr + ".")};
	export.objectadr = adr;
	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.