Page 1 of 1

Open the Find window and setting the cursor

Posted: 2007-07-30 01:19:14
by js
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?

Posted: 2007-07-30 13:53:01
by martin
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.

Re: Open the Find window and setting the cursor

Posted: 2009-12-27 20:17:28
by Kino
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.