Reply to topic  [ 11 posts ] 
Need a macro to insert html italics code 
Author Message

Joined: 2008-03-03 21:01:15
Posts: 4
I need a macro--or some other cool find-and-replace solution--for Nisus Writer Express that will enable me to change text formatted in italics to text marked with <i> and </i> for posting on the web.

Does anyone have such a thing already, or can tell me how to make it? (I have, I'm sorry to say, no experience with macros at all. Sigh.)


2008-03-03 21:07:56
Profile
User avatar

Joined: 2007-01-17 03:25:42
Posts: 729
It is possible to save your file from within NWE as HTML. Or am I missing something?


2008-03-04 03:00:55
Profile

Joined: 2008-03-03 21:01:15
Posts: 4
Post 
Unfortunately, "save as html" formats everything, and introduces a lot of code I don't want in this file. I only want to provide html for text in italics. The thing is, it's a long document with lots of scattered italics, and finding and changing each incidence by hand is pretty tedious.

This seems like the sort of thing a macro is good for, in other words...


2008-03-04 12:29:44
Profile

Joined: 2007-03-03 09:55:06
Posts: 494
Location: Europe
Post 
Hello.

NWE can't search text with attributes. You need Pro for this. Anyway, here is a workaround.

Click on any italics text and select Select All from the character tag pop-up (the tiny letter "a" that appears in the statusbar).
Open the Find and Replace window.
Activate PowerFind Pro.
In Where, select In Selection.
In the Find What box, digit: .+
In the Replace with box, digit: <I>\0</I>
Click Replace All.

I only tried this on NWP, but think NWE is the same.

Cheers,
Henry.


2008-03-04 13:09:16
Profile
Official Nisus Person
User avatar

Joined: 2002-07-11 17:14:10
Posts: 4251
Location: San Diego, CA
Post 
Henry is right, attribute sensitive Find & Replace (and most macro features) are only available in Pro.

One correction to his list of steps: instead of typing "/0" you'll want to type "<i>/0</i>".


2008-03-04 13:30:49
Profile WWW

Joined: 2008-03-03 21:01:15
Posts: 4
Post 
Thank you--that's a considerable help. At least this way I can find each occurrance of italicized text in order and enter the html by hand, rather than having to click the little attribute symbol, select all the italics, and scroll down to find the next word or phrase that needs doctoring.

Would I be able to actually find italicized text and add <i> and </i> to either end of it, via find and replace, in Nisus Writer Pro?

(By the way, thank you, all--I really appreciate that you're here and sharing these things.)


2008-03-04 13:40:46
Profile

Joined: 2007-03-03 09:55:06
Posts: 494
Location: Europe
Post 
martin wrote:
One correction to his list of steps: instead of typing "/0" you'll want to type "<i>/0</i>".


Oh, my! That was my writing, Martin. Only I forgot clicking Disable HTML in this post.

Henry.


2008-03-04 13:52:17
Profile
Official Nisus Person
User avatar

Joined: 2002-07-11 17:14:10
Posts: 4251
Location: San Diego, CA
Post 
coffee em wrote:
Would I be able to actually find italicized text and add <i> and </i> to either end of it, via find and replace, in Nisus Writer Pro?

Yes, here's the list of steps you would take:

1. Open the Find panel, set the "using" mode to "PowerFind Pro".
2. In "find what" type ".+" and apply italics to that text. Applying italics should automatically turn on the "attribute sensitive" checkbox just below.
3. In "replace with" type "<i>/0</i>"
4. Click the "Replace All" button.

This is more accurate than using the font tag (the little "a" icon) in Express, because the "select all" menu matches all font attributes (eg: size, face) of the selection, not just italics.

Groucho wrote:
Oh, my! That was my writing, Martin. Only I forgot clicking Disable HTML in this post.

I made the same mistake when I first replied to your post :P


2008-03-04 14:01:03
Profile WWW

Joined: 2008-03-03 21:01:15
Posts: 4
Post 
I have only one thing to say:

Where do I send the chocolate?

You guys rawk.


2008-03-05 12:44:42
Profile
User avatar

Joined: 2007-01-17 03:25:42
Posts: 729
coffee em wrote:
Where do I send the chocolate?
...or rather Pockey:
http://www.nisus.com/blogs/?p=168


2008-03-05 12:53:16
Profile
Official Nisus Person
User avatar

Joined: 2002-07-11 17:14:10
Posts: 4251
Location: San Diego, CA
Post 
And don't forget oversized giant pocky!


2008-03-07 00:59:04
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 11 posts ] 

Who is online

Users browsing this forum: No registered users and 3 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