May 3, 2012 at 8:57 pm #10311
Stefan
Participant
Shorter code, but takes more time due the use of regular expression:
// language = "JavaScript"
// Select whole paragraph macro.
// An paragraph is an block of text delimited by two empty lines.
// How to:
// 1. Have the cursor inside an paragraph.
// 2. execute this macro.
o = document.selection;
o.Find("^s*$",eeFindPrevious | eeFindReplaceRegExp);
yPosBeg = o.GetActivePointY(eePosLogical) +1;
o.Find("^s*$",eeFindNext | eeFindReplaceRegExp);
yPosEnd = o.GetActivePointY(eePosLogical);
o.SetAnchorPoint(eePosLogical, 1, yPosBeg);
o.SetActivePoint(eePosLogical, 1, yPosEnd, True);