Find window without attributes

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

Find window without attributes

Post by js » 2008-08-13 04:41:00

Is there any Macro with which to get a clean Find Window. F.e. if I enter colored text „Use selection for Find“, and then want to do a new search without attributes, I had hoped that applying a macro like this would do:

Find and Replace '', '', '-uE!'

But I find that starting to typ my find text, Apple is still using the earlier color and setting the Find window to „Attribute Sensitive“, which I have then to unclick manually.

A related question: Is it possible by means of a macro, to put the „Attribute sensitive“ button of (but keeping the find text already entered)?

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

Re: Find window without attributes

Post by martin » 2008-08-13 10:43:09

js wrote:Is there any Macro with which to get a clean Find Window. F.e. if I enter colored text „Use selection for Find“, and then want to do a new search without attributes, I had hoped that applying a macro like this would do:

Find and Replace '', '', '-uE!'

But I find that starting to typ my find text, Apple is still using the earlier color and setting the Find window to „Attribute Sensitive“, which I have then to unclick manually.
You'll want to set a plain string in the find window, without any attributes, which can be done like so:

Code: Select all

$plainString = Cast to String ''
Find $plainString, '-uE!'
A related question: Is it possible by means of a macro, to put the „Attribute sensitive“ button of (but keeping the find text already entered)?
This is possible, but a little trickier than you would think, here's how:

Code: Select all

$expression = Read Find Expression
Find $expression, '*-u!'
The above code should preserve every setting in the Find window except the "attribute sensitive" option, which is cleared. This works because the macro "*" option says to use the find window settings. These are then modified by "-u" to remove attribute sensitivity, and finally set back in the find window using "!".

js
Posts: 229
Joined: 2007-04-12 14:59:36

Re: Find window without attributes

Post by js » 2008-08-13 21:50:13

Thanks for your help. And glad to know that it was not that simple as I had thought it was.

Post Reply