Finding the next table

Everything related to our flagship word processor.
Post Reply
js
Posts: 260
Joined: 2007-04-12 14:59:36

Finding the next table

Post by js »

How does one find the next table in a long text?
User avatar
martin
Official Nisus Person
Posts: 5230
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: Finding the next table

Post by martin »

There's a very short macro that can do this:

Code: Select all

Select Next Table
If you want to get a little fancier, with an option to wrap the search back to the document start:

Code: Select all

$foundTable = Select Next Table
If ! $foundTable
	# prompt always includes a button to cancel the macro
	Prompt "No more tables found. Would you like to search from the start of the document?", '', 'Search From Start'
	Select Document Start
	Select Next Table
End
js
Posts: 260
Joined: 2007-04-12 14:59:36

Re: Finding the next table

Post by js »

Thank you.
Your macro lets me turn round. But I found that strangely you can jump only downwards from table to table, but not upwards, which was maybe why you wrote it.
Following your model I wrote this which allows to go upward. Arriving on table one repeating it keeps the selection to let you know.

Code: Select all

$foundTable = Select previous table
If $foundTable
Send Selector 'moveUp:'# to get out of the table in case you are trapped in a selection
End

Select previous table
Scroll to Selection
User avatar
martin
Official Nisus Person
Posts: 5230
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: Finding the next table

Post by martin »

I'm glad you found my macro useful. I'm not sure I understand yours. Just the simple:

Code: Select all

Select Previous Table
..works for me. Your macro jumps up by two tables at a time.
js
Posts: 260
Joined: 2007-04-12 14:59:36

Re: Finding the next table

Post by js »

I can't explain it. I tried to copy some of my tables from the document in question into a new document, putting some text between. Now it works as you say (and my macro leaves one out). Mystery.
Same thing with a macro consisting of nothing than the line "select previous table".
Post Reply