In the case of following sentences:
"Now is the time for this work. Now is the time for this work. Now is the time for this work. Now is the time for this work."
Using the Select Sentence macro with the cursor in front of the first "Now", the entire next sentence is selected.
Moving the cursor between the end of the first sentence and the word "Now" of the second sentence, the macro selects both the first and the second sentences.
Moving he cursor between the end of the second sentence, and the word "Now" of the third sentence, the macro selects the second sentence instead of the third sentences.
Am I missing something, or is this macro buggy?
Selecting Next Sentence Backwards?
Re: Selecting Next Sentence Backwards?
In NWP 1.3 and later, you’d better use the menu command :Edit:Select:Select Sentence (which takes account of abbreviations) to select the current or the next sentence. As to selecting the previous sentence, something like this will do the job.
Code: Select all
$selSentence = ':Edit:Select:Select Sentence'
$sel = TextSelection.active
Menu $selSentence
Select Start
if Find Previous '\S+', 'E-W'
Menu $selSentence
else # restore the selection
TextSelection.setActiveRange $sel
end
Last edited by Kino on 2010-02-01 20:02:51, edited 1 time in total.
- martin
- Official Nisus Person
- Posts: 5230
- Joined: 2002-07-11 17:14:10
- Location: San Diego, CA
- Contact:
Re: Selecting Next Sentence Backwards?
Kino's suggestions are good ones, the menu Edit > Select > Select Sentence should behave much more reliably. His macro is also better than our old macro; I'll see about updating our macro repository to take advantage of the new menu.