topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday December 13, 2024, 1:06 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: easily copy and paste multiple text strings  (Read 5007 times)

kalos

  • Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 1,824
    • View Profile
    • Donate to Member
easily copy and paste multiple text strings
« on: December 29, 2011, 07:15 AM »
hello

I want to copy text strings that are seperated by newlines or commas or tabs and I want to paste each one after the other (as I would read that text) by hitting a hotkey

for example:

this is, an example, of text
that I, want to, be pasted


I want to hit eg. CTRL+T and paste this is
then hit CTRL+T and paste an example

and so on

how can I do this?

thanks!

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: easily copy and paste multiple text strings
« Reply #1 on: December 29, 2011, 07:24 AM »
Question:

Would it be helpful if the Ctrl+T pressing was automated as well?

kalos

  • Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 1,824
    • View Profile
    • Donate to Member
Re: easily copy and paste multiple text strings
« Reply #2 on: December 29, 2011, 08:49 AM »
Question:

Would it be helpful if the Ctrl+T pressing was automated as well?

maybe, but how would I paste each string to the correct position in a grid? 

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: easily copy and paste multiple text strings
« Reply #3 on: December 29, 2011, 09:16 AM »
oh i thought it was an automated process where ctrl+T took you to the next field where you wanted to paste.

wr975

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 369
    • View Profile
    • Donate to Member
Re: easily copy and paste multiple text strings
« Reply #4 on: December 29, 2011, 09:47 AM »
I want to copy text strings that are seperated by newlines or commas or tabs and I want to paste each one after the other (as I would read that text) by hitting a hotkey

Hi,

here's a quick Autohotkey script. See attachment.

Usage:
1. Go to http://www.autohotkey.com and download/install the tool (AHK_L 32 bit unicode)
2. Copy your comma/tab/newline separated text in the clipboard
3. Start the script. It'll read the contents of the clipboard
4. Press CTRL+T to paste the text, or CTRL+E to exit the script

#SingleInstance force

x := clipboard
StringReplace,x,x,%A_Tab%,`,,1
Loop,Parse,x,`n,`r
y .= ((If y = "") ? "" : ",") . A_LoopField
StringReplace,y,y,`,`,,`,,1
msgbox,CTRL+T to paste text`nCTRL+E to exit script
Return

^E::
ExitApp
Return

^T::
z := ""
Loop,Parse,y,`,
{
If (Trim(A_LoopField) = "")
Continue
if (z = "")
z .= Trim(A_LoopField)
else
y1 .= ((If y1 = "") ? "" : ",") . A_LoopField
}
y := y1
y1 := ""
If (z = "")
{
ToolTip, Nothing more to paste...
Sleep,5000
ToolTip
Return
}
Clipboard := z
Send,^v
return


kalos

  • Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 1,824
    • View Profile
    • Donate to Member
Re: easily copy and paste multiple text strings
« Reply #5 on: December 30, 2011, 04:08 AM »
it works very well! thanks!
just an addition, can you make it display a tooltip when it pastes the last string of a line and is about to paste the first string of the next/below line ?