Quick find

Get help using and writing Nisus Writer Pro macros.
Post Reply
lawrencegoodman
Posts: 30
Joined: 2007-07-30 12:06:49

Quick find

Post by lawrencegoodman » 2007-10-29 10:53:05

one of the features i like most about plain old fashioned text editors is that you can call up the find/replace dialogue, enter what you want it to find, it moves you to that word, and then the find box disappears automatically. it just saves you the annoyance of having to close the find box yourself.

i was wondering if it might be possible to create a macro that asked the user for a find string, found the string, and then the window disappeared and you could start typing. the other cool thing would be for the find string you entered to become the default find value so if you hit command+g it will search again for the find string you entered when the macro ran.

just a thought. thanks.

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

Post by martin » 2007-10-29 14:29:45

This should do the trick:

Code: Select all

$search = Read Find Expression
$search = Prompt Input “What would you like to search for?”, “Please enter the text you would like to search your document for.”, “Find”, $search
Write Find Expression $search
Find $search

lawrencegoodman
Posts: 30
Joined: 2007-07-30 12:06:49

Post by lawrencegoodman » 2007-10-29 15:55:38

Fantastic. Thanks. Who knew it would be so easy?

Post Reply