How to copy massive data to clipboard Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
cahek0404
Posts: 7
Joined: 20 Jul 2019, 15:42

How to copy massive data to clipboard

20 Jul 2019, 15:47

I have an array [1, 2, 56, 32, " ", 54] or something.

How do i send it to clipboard
Spoiler
I tried this.
Spoiler
nou
Posts: 26
Joined: 24 Feb 2019, 21:21

Re: How to copy massive data to clipboard

20 Jul 2019, 15:53

You would do something like this:

Code: Select all

table :=  [1, 2, 56, 32, 54]

meow := "" 
Loop % table.count() {
	meow := table[A_Index] "`n"
}

Clipboard := meow
gregster
Posts: 9103
Joined: 30 Sep 2013, 06:48

Re: How to copy massive data to clipboard  Topic is solved

20 Jul 2019, 15:57

Something like this (concatenation)?

Code: Select all

table :=  [1, 2, 56, 32, " ", 54]
clipboard := ""

Loop % table.MaxIndex() {
	meow := table[A_Index]
	Clipboard .= meow "`r"
}
https://www.autohotkey.com/docs/Variables.htm#AssignOp wrote:Var .= "abc" is a shorthand way of writing Var := Var . "abc".
cahek0404
Posts: 7
Joined: 20 Jul 2019, 15:42

Re: How to copy massive data to clipboard

20 Jul 2019, 17:36

gregster wrote:
20 Jul 2019, 15:57
Something like this (concatenation)?

Code: Select all

table :=  [1, 2, 56, 32, " ", 54]
clipboard := ""

Loop % table.MaxIndex() {
	meow := table[A_Index]
	Clipboard .= meow "`r"
}
https://www.autohotkey.com/docs/Variables.htm#AssignOp wrote:Var .= "abc" is a shorthand way of writing Var := Var . "abc".
Its work!

but I have one more question

I have that str
"• $121.71
• $125.05
• $125.05
• $125.05"
And this code

Code: Select all

^+v:: ; открытие продаж

table := Array()

ClipboardArray := StrSplit(clipboard, "`r")
Loop % ClipboardArray.MaxIndex()
{
	this_price := ClipboardArray[A_Index]
	quote = `"
	FoundPos := RegExMatch(this_price, quote)
	; MsgBox, Color number %A_Index% is %this_price%
		if (FoundPos = 2 or FoundPos = 1) {
			table.Push(SubStr(this_price, 5))
		} else if (RegExMatch(this_price, " ") = 0) {
			this_price := " "
			table.Push(this_price)
		}
}

Clipboard := ""

Loop % table.MaxIndex() {
	meow := table[A_Index]
	Clipboard .= meow "`r"
}

Return

How do I get the second elem? I try

Code: Select all

this_price[A_index +1]
but it not work

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], Felix Siano and 66 guests