Reply to topic  [ 6 posts ] 
Replace Highlighting 
Author Message

Joined: 2008-12-07 00:16:13
Posts: 3
I have what I hope is a simple question. All I'm trying to do is set up a sequence of find/replace operations so that the found string is replaced with the same string highlighted. The problem I am having is I can't figure out to to do the highlighting. If I do it in the macros it doesn't transfer over.

Anyone have a simple answer for this? :)

Thanks


2008-12-07 00:50:26
Profile

Joined: 2008-12-07 00:16:13
Posts: 3
Related question. I'm a newbie and trying to figure out this newbie thing. The problem I am having is that the manual says find and replace should be structured:

Find/Replace`"Find`Pattern"`"Replacement`Pattern" "Options"

But I've figured out that it really needs to be:

Find and Replace 'Find Pattern', 'Replacement Patters', 'Options'

Am I missing something incredibly obvious, is the guide an old version, or is this just something any person with minimal programming experience would know? I'm a little worried I'm going to try and keep learning directly from the manual and I'll learn its "Find and Replace" not "Find/Replace" for just about everything. I'd love to avoid that confusion.

Anyone that give give insight or advice on how to learn this, I'd be grateful.


2008-12-07 00:59:36
Profile

Joined: 2007-03-03 09:55:06
Posts: 494
Location: Europe
catstretch wrote:
Related question. I'm a newbie and trying to figure out this newbie thing. The problem I am having is that the manual says find and replace should be structured:

Find/Replace`"Find`Pattern"`"Replacement`Pattern" "Options"

But I've figured out that it really needs to be:

Find and Replace 'Find Pattern', 'Replacement Patters', 'Options'
Hi, Catstretch.

The second pattern is right. You can use single or double quotes, straight or curly.
By the way, where in the manual did you find the first pattern?

As for the highlight, if you want to highlight some text through a macro you can use this simple code:
Code:
Find "Find_Text", "a"
Format:Highlight:Yellow

Change Yellow with whatsoever color you prefer.

Cheers, Henry.


2008-12-07 02:16:58
Profile

Joined: 2008-12-07 00:16:13
Posts: 3
I found it on page 365 of the User's Guide.

Is there a way for me to know what colors are available? More importantly, is there a way for me to highlight multiple words and either highlight them at the same time or one after another? I've tried a few different ways and I only ever get one of the find searches I do to highlight.

Than you a lot for your help.
- Catstretch


2008-12-07 09:14:16
Profile

Joined: 2007-03-03 09:55:06
Posts: 494
Location: Europe
Available colors are listed in Format > Highlight. If you click on Show Highlight Colors you can set a custom color of your liking from the system color picker.
If you want to highlight occurrences one by one you had better use the Find and Replace command under Edit menu. Enable PowerFind Pro and digit as follows:

Find what: Text_to_search
Replace with: \0

Then select \0 and go to Format > Highlight > Yellow (or another color).
Click on Next and then either Replace and Find, if you want to highlight found text, or Next, if you don't want to highlight it.

I hope this will do the job.

Cheers, Henry


2008-12-08 02:24:18
Profile
Official Nisus Person
User avatar

Joined: 2002-07-11 17:14:10
Posts: 4251
Location: San Diego, CA
catstretch wrote:
I found it on page 365 of the User's Guide.

Perhaps you have an old copy of the User Guide; in the current guide that page is a listing in the index. You can always get to the most recent copy of the guide by choosing the menu Help > Nisus Writer Pro Help.

Quote:
Is there a way for me to know what colors are available?

As Henry mentioned the colors are listed on the menu Format > Highlight. You might also check the menu Format > Background Color, which has more choices.

If you're looking for even finer control, you can create your own colors in the macro by specifying the exact mix of red/green/blue (RGB). An example that marks text with a lighter blue color:
Code:
Find All "blue"
$color = Color.newWithRGB(0.2, 0.7, 1.0)
Set Background Color $color


Quote:
More importantly, is there a way for me to highlight multiple words and either highlight them at the same time or one after another?

Sure, just chain together multiple find commands:

Code:
Find All "yellow"
:Format:Highlight:Yellow

Find All "red"
:Format:Background Color:Red

Find All "blue"
$color = Color.newWithRGB(0.2, 0.7, 1.0)
Set Background Color $color


2008-12-08 13:03:24
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software