// Jongware, 9-Jun-2010
if (app.selection.length == 0 || !(app.selection[0].hasOwnProperty ("baseline")))
{
alert ("No text selection — bye.");
} else
{
p = app.selection[0];
src = p.parentStory.texts.itemByRange (p.paragraphs[0].texts[0], p.paragraphs.lastItem().texts[0]);
dst = p.parentStory.paragraphs.previousItem(src.paragraphs[0]);
if (dst != null)
src = src.move (LocationOptions.BEFORE, dst);
app.select(src);
}