Code: Select all
send, !a
send, !{tab}
clpbrd := Clipboard
ArrayOfText := StrSplit(clpbrd , "`r")
Clipboard :=
LineIndex := ArrayOfText._MaxIndex()
for index, value in ArrayOfText
ArrayOfText[index] := Trim(value, "`n")
Loop
{
if (LineIndex<>1)
{
Clipboard .= ArrayOfText[LineIndex] . "`r`n"
}
else
{
Clipboard .= ArrayOfText[LineIndex]
}
LineIndex--
} Until LineIndex = 0
Loop, Parse, Clipboard, `n, `r
{
NewWord := A_LoopField
New := True
Loop, %Number%
{
If (OldWords%A_Index% = NewWord)
{
New := False
Break
}
}
If New
{
Number++
OldWords%Number% := NewWord
Send, %NewWord%`n
}
}
Return
Code: Select all
.
This script above works well with my clipboard while was still using windows 8.1 and now I've changed to windows 10 and the script isn't working well on it, it will rather show run-time error 521 can't open clipboard and the rest functions in the script wont go through, pls how can I make my windows to be compatible and work well with my ahk script?