Very new.. Attempting to make my job a little easier

Get help with using AutoHotkey and its commands and hotkeys
ensouledtest3
Posts: 1
Joined: 05 Jan 2020, 19:50

Very new.. Attempting to make my job a little easier

05 Jan 2020, 19:57

I am trying to make a script that can select>copy multiple things from a document and then paste into a program. The document is formatted as such:

(thing to copy/paste into one line of the program):(Thing to copy/paste into another line of the program) *without parenthesis*

(thing to copy/paste into one line of the program):(Thing to copy/paste into another line of the program)

(thing to copy/paste into one line of the program):(Thing to copy/paste into another line of the program)

Is this even possible with AHK? Thanks in advance for any help.
User avatar
TheDewd
Posts: 1390
Joined: 19 Dec 2013, 11:16
Location: USA

Re: Very new.. Attempting to make my job a little easier

06 Jan 2020, 09:01

Yes, it should be possible.

Here's an example script showing how to parse the text on the left and right sides of the colon character:

Code: Select all

#SingleInstance, Force

SampleText =
(
Keyword1:Keyword2
Keyword3:Keyword4
Keyword5:Keyword6
Keywoed7:Keyword8
)

Loop, Parse, SampleText, `n, `r
{
	Line := A_Index

	Loop, Parse, A_LoopField, :
	{
		MsgBox, % "Line: " Line "`nPair: " A_Index "`nString: " A_LoopField
	}
}
Image Bulldozer - Sokoban inspired game from 1994 recreated in AutoHotkey.

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], boiler, Bral, congdantoancau, F4Jonatas, Kellyzkorner_NJ, malcev, ThumpieBunnyEve, wyatterp and 99 guests