Needs scripts for plain text paste and em dash Topic is solved
Needs scripts for plain text paste and em dash
These things are easy to do on MacOS with no need for AHK, but now that I'm on Windows I will needs scripts that would allow me to do both. Does anyone have either of these?
Re: Needs scripts for plain text paste and em dash Topic is solved
Here's some code. Cheers.
Code: Select all
q:: ;paste clipboard as plain text
Clipboard := Clipboard
SendInput, ^v
return
;note:
;vText := Clipboard stores the clipboard's plain text to a variable
;Clipboard := vText puts plain text onto the clipboard
w:: ;send em dash
SendInput, % Chr(A_IsUnicode ? 8212 : 151)
return
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
- JoeWinograd
- Posts: 2200
- Joined: 10 Feb 2014, 20:00
- Location: U.S. Central Time Zone
Re: Needs scripts for plain text paste and em dash
Hi kissinger,
You may find this thread from earlier this month about em dash and en dash to be helpful:
https://autohotkey.com/boards/viewtopic.php?f=5&t=46554
Regards, Joe
You may find this thread from earlier this month about em dash and en dash to be helpful:
https://autohotkey.com/boards/viewtopic.php?f=5&t=46554
Regards, Joe
Re: Needs scripts for plain text paste and em dash
Thanks both. Works great now.
- JoeWinograd
- Posts: 2200
- Joined: 10 Feb 2014, 20:00
- Location: U.S. Central Time Zone
Re: Needs scripts for plain text paste and em dash
You're welcome...glad to hear it...thanks for letting us know. Cheers, Joe
Re: Needs scripts for plain text paste and em dash
These scripts are still working fine, but I've noticed a quirk, which is that when I plain text paste large chunks of texts (e.g., several lines at a time) there is always a line break in the last line, which doesn't appear in the original copied section of text. Has anyone else noticed this? It might be a bug in Window for all I know, but it's certainly pretty annoying.
Re: Needs scripts for plain text paste and em dash
Are you copying from Excel? Excel adds a trailing line break, you can remove trailing linefeed/carriage return characters like so:
Or to remove just the last line break:
Code: Select all
vText := RTrim(Clipboard, "`r`n")
Code: Select all
vText := Clipboard
if RegExMatch(vText, "`r`n$")
vText := SubStr(vText, 1, -2)
;or:
vText := Clipboard
if (SubStr(vText, 1, StrLen(vText)-1) = "`r`n")
vText := SubStr(vText, 1, -2)
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Who is online
Users browsing this forum: RussF and 298 guests