Open the Find window and setting the cursor

Get help using and writing Nisus Writer Pro macros.
Post Reply
js
Posts: 229
Joined: 2007-04-12 14:59:36

Open the Find window and setting the cursor

Post by js » 2007-07-30 01:19:14

I often need to find a certain type of numerical expression that occurs after a tab, and I thought I might write a simple macro that opens the find window, puts a tab and sets the cursor after it, like

Code: Select all

Find and Replace '\t', '', 'E!'
Show find
Select End
But unexpectedly I run into two problems:
1) If the Find window is already open „Show find“ makes it disappear.
2) It seems the the Select end command does not execute in the find window
Is there a solution to this?

User avatar
martin
Official Nisus Person
Posts: 4261
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Post by martin » 2007-07-30 13:53:01

I'm sorry to say that there is no solution to this. I'll file two issues on this: first that the selection commands can't modify the Find dialog and another that Show Find menu should be literal in macros (and we should have a Hide Find command as well). Thanks.

Kino
Posts: 400
Joined: 2008-05-17 04:02:32

Re: Open the Find window and setting the cursor

Post by Kino » 2009-12-27 20:17:28

This one will do the job in NWP 1.3 or later.

Code: Select all

$find = Cast to String '\t'
Find and Replace $find, '', 'E!'
Set Find Shown true
Send Selector 'moveToEndOfParagraph:'
or, if it is unnecessary to set the find options, …

Code: Select all

Set Find Shown true
Send Text '\t'
Edit: added the second macro.

Post Reply