Can someone help me please. I have encountered a glitch in the workflow Scrivener --> Exported RTF --> Bookends scan --> NWP.
Scrivener uses the Apple text engine -- the same problem arises with TextEdit -- and exports en-dashes as Hex '96. NWP can read that OK, but when scanned with Bookends, the en-dashes appear converted to ñ when the resulting file is opened in NWP, as that is the glyph for '96 in the coding used by Bookends. Bookends and Nisus apparently output RTF with /endash as the coding.
This is of particular concern in marking number ranges such as page-ranges in footnotes. So what I would like is a macro that will go through a file and replace all instances of ñ occurring between numbers with –
I am not a programmer and have no knowledge of any of the languages used for NWP macros, nor currently do I have time to start teaching myself. So I was wondering if there is any kindly soul out there who could and would be willing to help put together what I can only think must be a pretty simple macro.
Many thanks.
Mark
Help needed: macro to replace ñ with – (en-dash)
- martin
- Official Nisus Person
- Posts: 5228
- Joined: 2002-07-11 17:14:10
- Location: San Diego, CA
- Contact:
Henry's Find & Replace should work exactly as you need. As a macro it simply looks like:
The 'Ea' means use PowerFind Pro and replace all matches.
Code: Select all
Find and Replace '([0-9])ñ([0-9])', '\1-\2', 'Ea'
Thank you Henry and Martin.
I use PowerFind Pro by default and knew I could do it in that, but I was thinking of a macro that I could allocate a keystroke combination to so that I wouldn't have to enter the string into Find and Replace each time I wanted to run it, which would not be at highly regular intervals to the extent that I would have to think about the grep code each time.
Thank you for the macro, Martin. I shall try installing it.
Yours
Mark
I use PowerFind Pro by default and knew I could do it in that, but I was thinking of a macro that I could allocate a keystroke combination to so that I wouldn't have to enter the string into Find and Replace each time I wanted to run it, which would not be at highly regular intervals to the extent that I would have to think about the grep code each time.
Thank you for the macro, Martin. I shall try installing it.
Yours
Mark