Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Copy-paste script



  • Please log in to reply
3 replies to this topic
V1P3R
  • Members
  • 28 posts
  • Last active: Jun 19 2018 12:13 PM
  • Joined: 26 Sep 2006
Hey!

Been trying to find some scripts, that replace the built-in copy-paste function of Windows in the following way:
2 Line Feeds=1 Line Feed
2 Spaces=1 Space
2 Exclaimation marks=1
etc.

Seems like an easy task, but I'm a bit over my head.

Any help appreciated.

Thanks in advance!

Sivvy
  • Members
  • 726 posts
  • Last active: Apr 23 2010 02:50 PM
  • Joined: 21 Jul 2008
^c::
ControlGet, Clipboard, Selected, , , A
StringReplace, Clipboard, Clipboard, `r`n`r`n, `r`n, All
StringReplace, Clipboard, Clipboard, %A_Space%%A_Space%, %A_Space%, All
StringReplace, Clipboard, Clipboard, `!`!, `!, All

This code will most likely not work with Rich Text. I'm not sure how to get Rich Text, but there might be something else on the forum. It also replaces your clipboard's CTRL-C. Change it as you please.

V1P3R
  • Members
  • 28 posts
  • Last active: Jun 19 2018 12:13 PM
  • Joined: 26 Sep 2006
Doesnt work at all at me for any format currently.
Though the code seemed right for what I need.
CTRL+V doesnt paste anything.
What could be the problem?

tidbit
  • Administrators
  • 2709 posts
  • Hates playing Janitor
  • Last active: Jan 15 2016 11:37 PM
  • Joined: 09 Mar 2008
✓  Best Answer
~^c:: 
ControlGet, Clipboard, Selected, , , A 
StringReplace, Clipboard, Clipboard, `r`n`r`n, `r`n, All 
StringReplace, Clipboard, Clipboard, %A_Space%%A_Space%, %A_Space%, All 
StringReplace, Clipboard, Clipboard, `!`!, `!, All
[color=red]return[/color]
(s)he forgot to add the closing return.
and the ~ to not "block" ctrl+c

rawr. be very afraid
*poke*
. Populate the AutoHotkey city. Pointless but somewhat fun. .