Loop through clip board lines and manipulate text

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
tazzzan33
Posts: 16
Joined: 07 Dec 2017, 12:41

Loop through clip board lines and manipulate text

13 Dec 2017, 13:36

I am currently trying to write a program that allows me to copy multiple lines of text and append a comma to the end of the line. (except for the last line).

However I have ran into errors with special characters and cannot figure out how to allow them to work. Id rather accept all characters into the clipboard rather than stripping them out if possible.

First I tried to replace them with RegExReplace but that has not worked and is giving me more errors. Please see the code below, I have put both the simple loop and the replace logic into it.

Code: Select all

#b::
index:=0
ClipSaved := ClipboardAll
Loop, parse, clipboard, `n, `r
{
	;
	;tmp :=RegExReplace(A_loopfield,[\\/:*?"<>|])    
	index+=1
	;MsgBox,%A_Index%   %tmp%,
	NewClip[index] := %A_LoopField%,
	
}
Return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Mannaia666, wpulford and 417 guests