;//Mon, Feb 12, 2007 --- 2/12/07, 4:28:19am #SingleInstance force F12::RemoveBlankLines("", "3+", 0, "EditPaste", "", "") +F12::RemoveBlankLines("", "2+", 0, "EditPaste", "", "") !F12::RemoveBlankLines("", "all", 0, "EditPaste", "", "") RemoveBlankLines(p_text="", p_regex=0, p_rep=0, p_paste="", p_ctrl="", p_hwnd="") { if (p_regex=0 || p_regex="3+") { if (p_rep=0) p_rep:="`n`n" p_regex={3,} } else if (p_regex="2+") { if (p_rep=0) p_rep:="`n" p_regex={2,} } else if (p_regex="all") { if (p_rep=0) p_rep:=" " p_regex=+ } if (p_text="") { cba:=ClipboardAll clipboard= Send, ^c ClipWait, .319 if (errorlevel) { Send, ^a^c ClipWait, .319 } if (!errorlevel) { p_text:=clipboard } if (p_paste="") { p_paste=1 } } if (p_text!="") { p_text:=RegExReplace(p_text, "[`r|`n]" p_regex, p_rep) if (p_paste!="") { if (p_paste="EditPaste") { Control, EditPaste, %p_text%, %p_ctrl%, %p_hwnd% if (errorlevel) { p_hwnd=a Control, EditPaste, %p_text%, %p_ctrl%, %p_hwnd% if (errorlevel) { msgbox, 16, , (LTrim Error: EditPaste Failed! Control, EditPaste, `%p_text`%, p_ctrl(%p_ctrl%), p_hwnd(%p_hwnd%) ) } } } else { clipboard:=p_text Send, ^v } } } else msgbox, 16, , Error: No text to process! if (cba) clipboard:=cba } /* Test Block 1 2 3 4 5 6 7 8 */