Reply to topic  [ 2 posts ] 
Macro to Delete Unitl End of Sentence 
Author Message

Joined: 2007-07-30 12:06:49
Posts: 30
Another macro request:
I need a macro that will deletete from the cursor to the end of the sentence (i.e. the period).

Any advice?

Thanks.


2007-10-19 08:25:46
Profile
Official Nisus Person
User avatar

Joined: 2002-07-11 17:14:10
Posts: 4251
Location: San Diego, CA
Post 
This should do what you're looking for:

Code:
$deleteStart = Selection Location
$deleteLen = 0

# find the end of the current sentence
Find '($|\.(?![0-9])|[!?]+)[ \t]*', "E"
$selStart = Selection Location
$selLen = Selection Length
Begin Perl
$deleteLen = $selStart - $deleteStart;
End

# Select the sentence and delete it
Set Selection $deleteStart, $deleteLen
Delete


We also have some other sentence navigation macros in our macro repository.


2007-10-19 14:25:03
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software