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


on getImageClipboardText (f, url, adrtemplate=nil) {
		<<7/2/10; 6:37:42 AM by DW
	local (adrdata = scripting2suite.init (), t, height, width, s);
	new (tabletype, @t);
	bundle { //set height, width
		if string.lower (f) endswith ".gif" {
			local (hw = html.getgifheightwidth (f));
			height = hw [1];
			width = hw [2]}
		else {
			hw = html.getjpegheightwidth (f);
			height = hw [1];
			width = hw [2]}};
	t.url = url;
	t.height = height;
	t.width = width;
	t.filename = file.filefrompath (f);
	if adrtemplate == nil {
		s = string (adrdata^.editor.prefs.watchedFolder.clipboardTemplate)}
	else {
		s = string (adrtemplate^)};
	return (string.multipleReplaceAll (s, @t, false, "<%", "%>"))};
bundle { //test code
	webbrowser.displaytext (getImageClipboardText ("Macintosh HD:Users:davewiner:Dropbox:www:logo design files:logo2.gif", ""))}

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.