diff options
author | breadcat | 2018-04-26 11:16:20 +0100 |
---|---|---|
committer | breadcat | 2018-04-26 11:16:20 +0100 |
commit | 9d306241cee1ff710ef50610258f2716207ec1ae (patch) | |
tree | f5004a3dc446866d58abe9c8a6a23001a7395aff | |
parent | 90407d6486bb6f0433f8a7c0164c085a7734abbd (diff) | |
download | ahka-9d306241cee1ff710ef50610258f2716207ec1ae.tar.gz ahka-9d306241cee1ff710ef50610258f2716207ec1ae.tar.bz2 ahka-9d306241cee1ff710ef50610258f2716207ec1ae.zip |
Revert pasteClipboard()
Regex method was a little over-enthusiastic.
-rw-r--r-- | ahk-assistant.ahk | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/ahk-assistant.ahk b/ahk-assistant.ahk index 124f8f1..f14bba1 100644 --- a/ahk-assistant.ahk +++ b/ahk-assistant.ahk @@ -601,9 +601,13 @@ appendClipboard() { }
pasteClipboard() { ; manually paste clipboard, minus most formatting
- pastedClipboard := RegExReplace(clipboard, "[\W_]+") ; remove underscores, non-numbers and non-letters
- SendRaw %pastedClipboard%
- pastedClipboard :=
+ StringReplace, clipboard, clipboard, ?,, All ; remove bullet points
+ StringReplace, clipboard, clipboard, ·,, All ; remove middots
+ StringReplace, clipboard, clipboard, %A_Tab%,, All ; remove tabs
+ StringReplace, clipboard, clipboard, `r,, All ; remove half of line breaks
+ StringReplace, clipboard, clipboard, `n,, All ; remove other half of line breaks
+ clipboard = %clipboard% ; trim whitespace
+ SendRaw %clipboard%
Return
}
|