Reply to topic  [ 5 posts ] 
Convert Bold and Italics to normal 
Author Message

Joined: 2014-07-18 18:32:13
Posts: 28
Hi ,
I have two question.

For a rind and Replace you can make a selected word Bold or italics .

How can you do the opposite. Is there a not command or special syntax. To get a bold or italic word without those formats?

Also if you macroize in Find and Replace you have two separate macros one for find and one for replace . Do you merge them?

Or what is most efficient way to wind up with one macro not two?

Thanks,

David


2014-09-11 07:24:37
Profile
User avatar

Joined: 2007-02-07 00:58:12
Posts: 876
Location: Japan
davidrcalvert wrote:
Hi ,
I have two question.

For a rind and Replace you can make a selected word Bold or italics .

How can you do the opposite. Is there a not command or special syntax. To get a bold or italic word without those formats?


It's true that you can use Find and Replace to change styles, but I actually prefer a slightly different method. I use Find, but then I apply (or remove) the styles with menu commands. So:

Code:
Find all …
Bold


Now actually this code has one small problem. If the Find is unsuccessful, the Bold will apply to whatever was selected before. To avoid this, write:
Code:
if Find all '.+', 'Eau'
Bold
end

NB: styles applied to the find expression as needed.

Quote:
Also if you macroize in Find and Replace you have two separate macros one for find and one for replace . Do you merge them?

Or what is most efficient way to wind up with one macro not two?


The macroize function has an option to "Copy to clipboard". So I usually use that for the second, third, etc. find statement. Of course, once you get more familiar with the Find syntax, you can just write them into the macro directly :)

_________________
philip


2014-09-11 07:45:02
Profile
User avatar

Joined: 2007-02-07 00:58:12
Posts: 876
Location: Japan
davidrcalvert wrote:
Also if you macroize in Find and Replace you have two separate macros one for find and one for replace . Do you merge them?
Or what is most efficient way to wind up with one macro not two?


Actually, now that I re-read this question, i'm a bit confused; what do you mean 'one for Find and one for Replace'? The macroize function allows you to choose among several options ('Find Next', 'Find Previous', etc.). If you want to do a Find and Replace in one go you just choose 'Replace All', which will give you a 'Find and Replace'. Note that the Find dialog, somewhat confusingly, puts the macroize command in both drop down menus: next to the Find box and next to the Replace box. But they both give you the same options, and the result of macroizing is the same in both cases.

But if you want to do several Find and Replace commands in sequence, then my earlier advice applies.

_________________
philip


2014-09-11 07:55:57
Profile

Joined: 2014-07-18 18:32:13
Posts: 28
I understand the Find and Replace part of Macroize now. Thanks for the info.

However on a general note I understand how to make a macro to change text to bold and italics but how do you change the existing Bold or Italicized text to normal Not Bold or not Italics?

In general is there a macro syntax that would be used such as not format.

Hope that makes sense.


Thanks,

David


2014-10-11 07:01:40
Profile
User avatar

Joined: 2007-02-07 00:58:12
Posts: 876
Location: Japan
davidrcalvert wrote:
However on a general note I understand how to make a macro to change text to bold and italics but how do you change the existing Bold or Italicized text to normal Not Bold or not Italics?

In general is there a macro syntax that would be used such as not format.


There isn't really a "general" way to unformat text, but there are actually a whole number of ways. For a start Bold and Italic are toggle settings, so you can just apply them again to remove them. This is probably the best way when you want to want to remove one of them and not affect the other. Of course to make sure they turn the relevant setting 'off', you would need a Find statement to make sure to select only the part where the setting is 'on'. That was the point of the macro that I explained above.

But there are other ways. The "Font Face" submenu also has a "Regular" option which can be used directly to go to 'off'. This will turn off both Italic and Bold at the same time.
In general if you want to remove all forms of formatting you can use the command "Remove Attributes except Styles".
Another method is to use styles to cancel out certain combinations. The style should have the attributes you want to remove; apply the style then remove it.

And finally one can write macros with the macro language to manipulate styles, although this is unfortunately not as straightforward as it could be, and in the end I think amounts to using the same menu commands.

_________________
philip


2014-10-11 07:38:44
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


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:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software