are you sure you are doing it right? it should replace the selected paragraph with the modified one.
here is the whole file, maybe it works if you run the whole file
; Win + B
; Replaces the selected text with ,a removed of all linebreaks only, version
; Win + A
; Replaces the selected text with ,a removed of all linebreaks and added a linebreak after every period, version
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#Persistent
return
;......................................
#b::
Clipboard := ""
Loop, {
SendInput, ^c
ClipWait, 0.5
If (ErrorLevel = 0)
Break
}
ToolTip Clipboard data type: %A_EventInfo%
StringReplace, Clipboard, Clipboard, `r`n,%A_Space%, All
ClipSaved := ClipboardAll ; Save the entire clipboard to a variable of your choice.
; ... here make temporary use of the clipboard, such as for pasting Unicode text via Transform Unicode ...
Clipboard := ClipSaved ; Restore the original clipboard. Note the use of Clipboard (not ClipboardAll).
clipboard := RegExReplace(clipboard,"\. +",".`n")
Sleep 1000
ToolTip ; Turn off the tip.
SendInput %Clipboard%
return
; ....................................................
#a::
Clipboard := ""
Loop, {
SendInput, ^c
ClipWait, 0.5
If (ErrorLevel = 0)
Break
}
ToolTip Clipboard data type: %A_EventInfo%
StringReplace, Clipboard, Clipboard, `r`n,%A_Space%, All
Sleep 1000
ToolTip ; Turn off the tip.
SendInput %Clipboard%
return