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

system.verbs.apps.BBEdit.examples.window2Position

on window2Position() {
	<<Revisions:
		<<11/25/95 ECT: removed rect() call
		<<10/31/95 ECT: changed multiple calls to local() to outline
		<<08/19/95 ECT: ported from AppleScript to UserTalk
	<<Description:
		<<Move window to top-right position on a 1024-pixel wide screen. Used with putting two files,
		<<80 columns wide, side by side on a 17” screen, but this one doesnŐt resize the window.
	with objectModel, BBEdit, eventInfo {
		<<Remember: {top, left, bottom, right}
		local {
			lRect = get(window[1].bounds);
			lHeight = (number(string.nthField(lRect, ',', 3)) - number(string.nthField(lRect, ',', 1)));
			lWidth = (number(string.nthField(lRect, ',', 4)) - number(string.nthField(lRect, ',', 2)))};
		<<Remember: {left, top, right, bottom}
		set(window[1].bounds, {514, 41, (514 + lWidth), (41 + lHeight)})}};
window2Position()



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.