Archive of UserLand's first discussion group, started October 5, 1998.

Re: Join and Split outliner commands

Author:Oliver Wrede
Posted:4/12/1999; 1:42:42 AM
Topic:Join and Split outliner commands
Msg #:4952 (In response to 4939)
Prev/Next:4951 / 4953

Little cosmetic update: the join-script seems to create spaces inbetween former paragraphs. So I'd put a "endswith"-clause to check wether there is already a space at the end...

local (w = window.frontMost ());
local (okTypes = {scriptType, outlineType});
if okTypes contains window.getType (w) {
	local (s1 = op.getLineText ());
	if not op.go (down, 1) {
		return (true)};
	local (s2 = op.getLineText ());
	if op.go (right, 1) { //are there subheads?
		op.go (left, 1);
		op.go (up, 1);
		return (false)};
	local ( s );
	if s1 endsWith " " {
		s = s1 + s2}
	else {
		s = s1 + " " + s2};
	op.deleteLine ();
	op.setLineText (s)}





This page was archived on 6/13/2001; 4:49:19 PM.

© Copyright 1998-2001 UserLand Software, Inc.