Archive of UserLand's first discussion group, started October 5, 1998.
Re: Join and Split outliner commands
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.