Reply to topic  [ 3 posts ] 
Get Paragraph number 
Author Message

Joined: 2007-03-28 07:30:34
Posts: 139
For a variety of editing tools, I would like to select the paragraph where the insertion point is placed as a first step. This can be done using:

Code:
Select Previous Paragraph
Select Next Paragaph


I tried
Code:
Select Relative Paragraph 0


but this doesn't work.

Or, it could be done using
Code:
Select Paragraph (number)


except I can't find any way for the macro to Get Paragraph number. Is there a way?

Cliff Bender


2009-05-19 07:26:18
Profile

Joined: 2008-05-17 04:02:32
Posts: 400
credneb wrote:
I can't find any way for the macro to Get Paragraph number. Is there a way?

No. As of the version 1.2, there is not a reliable way to do so. You could try something like this:
Code:
$sel = TextSelection.active
$i = 1
while Select Previous Paragraph
   $i += 1
end
Select Paragraph $i
exit $i
but the paragraph number returned by it differs from the one shown by NW Pro when there is a table and the code is obviously stupid if your purpose is just to "select the paragraph where the insertion point is placed".


2009-05-20 05:07:55
Profile

Joined: 2007-03-28 07:30:34
Posts: 139
Thanks for confirming that there is no way to get the paragraph number in a macro.

I guess that there is likewise no way to get the number of the other objects used by the various Select (object) [i]number[/i] commands. If you can't get the number, I can't see a use for these commands -- but I'm sure someone will.


2009-05-20 05:23:32
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 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