Find and replace, The list of find options, Embedding perl – Nisus Writer Pro User Manual

Page 429

Advertising
background image

Customizing & Automating Solutions

409

message is displayed in the dialog in bold, as a title and the text in the details is placed in
plain format, below the title. The texts in the defaultButton and otherButton are displayed as
the respective button titles.

Prompt Input message, [detail], [button], [defaultText]

Displays a message to the user and allows them to type in some free-form text. This
instruction returns the text that the user has entered. Only one button is displayed for the
user to click when they have finished.

Prompt Options message, [detail], [button], [option1] … [optionN]

Displays a message and has the user choose one from a list of options. The return value is
the option they chose. An example:

$color = Prompt Options 'Favorite color?', '', 'OK', 'Red', 'Green',

'Blue'

If the user chooses Red, the text Red is returned and stored in the variable $color.

Find and replace

Find text, [options]

Finds and selects the given text. Options is a string, each letter turning on a separate
feature. This list is documented after the replace command:

Find and Replace find, replace, [options]

Finds the given text, replaces it with the new text, and selects it.

The list of find options

Table 31

Find/Replace macro option symbols

Each option letter can be preceded with a minus to turn off the given option. By default “i” and
“W” (case insensitive and wrap around search) are the only options that are turned on.

Embedding Perl

You can nest Perl instructions inside a menu macro using a Perl block.

Begin Perl

Perl code

*

!

a

b

e
E

i

r
s

u

U

v

w

W

 

Use options currently set in Find/Replace window. You can still add additional options as you
like.

Copy text/options into the Find/Replace window instead of doing an actual find and replace.

Find or replace

a

ll instances, instead of just the very next one.

Search

b

ackwards (reverse).

PowerFind

e

xpressions

PowerFind Pro

E

xpressions

Case

i

nsensitive search, the default setting.

Search

r

everse (backwards).

Limit search and replace to current

s

election.

Search is text attribute sensitive.

Replacement text is attribute sensitive, that is takes its attributes from the replace text.

Display the number of matches/replacements to the user (

v

erbose).

Whole

w

ord.

W

rap around, that is re-start the search from the start of document when the end is reached,

the default setting.

Advertising