Retain formatting with string replace Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Cyrus

Retain formatting with string replace

30 Apr 2017, 20:07

I use this code to hyphenate text in documents I work with;

Code: Select all

Send ^a
Send ^x
StringCaseSense, On
Loop
{
    StringReplace, clipboard, clipboard, case sensitive, case-sensitive, UseErrorLevel
    if ErrorLevel = 0  ; 
        break
}
Loop
{
    StringReplace, clipboard, clipboard, CASE SENSITIVE, CASE-SENSITIVE, UseErrorLevel
    if ErrorLevel = 0  ; 
        break
}
StringCaseSense, Off
Send ^v
This works, but there are headings in the text which are in bold font. The bolding disappears with the script. Is there a way I can retain the formatting of the text using StringReplace, or through some other method?
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Retain formatting with string replace  Topic is solved

01 May 2017, 14:10

Just out of curiosity, what's your input file format (doc,docx,rft, ... AFAIK the end of line character contains all format information, once deleted/transformed that info is gone. Test it yourself if cut & paste a formatted text into MSWord and/or notepad), and btw, what's the output file format you expect?

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 195 guests