Jump to content

clipboard contents to array


Recommended Posts

Hello

I am trying to store the last 5 clipboard contents to a array. When i run my code, autoit is jumping in front of the system control +c and it is not copying anything to the clipboard. I am stumped, any ideas?

 

Global $x=0
Global $arr[5]




HotKeySet("^c","_stepper")
#cs*******************************************************************************************************
//////////////////////////////////////////////////////////////////////////////////////////////////////////
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
#ce*******************************************************************************************************
func _stepper()
MsgBox(0, "Just message", "stepper is called")
    $arr[$x]=ClipGet()
        $x=$x+1
            if $x=5 then $x=0
MsgBox(0, "Just message",$x)
EndFunc
#cs*******************************************************************************************************
//////////////////////////////////////////////////////////////////////////////////////////////////////////
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
#ce*******************************************************************************************************
While 1

    Sleep(500)
    WEnd

 

 

 

 

Link to comment
Share on other sites

Add this as the beginning of _stepper():

HotKeySet("^c")
    Send("^c")
    HotKeySet("^c", "_stepper")

 

​Thank you . That works great. 

 

#include <array.au3>
Global $x=0
Global $arr[5]


HotKeySet("^c","_stepper")
#cs*******************************************************************************************************
//////////////////////////////////////////////////////////////////////////////////////////////////////////
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
#ce*******************************************************************************************************
func _stepper()

    HotKeySet("^c")
    Send("^c")
    HotKeySet("^c", "_stepper")

    $arr[$x]=ClipGet()
        $x=$x+1
            if $x=5 then $x=0
;_ArrayDisplay($arr)
EndFunc
#cs*******************************************************************************************************
//////////////////////////////////////////////////////////////////////////////////////////////////////////
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
#ce*******************************************************************************************************
While 1

    Sleep(300)
    WEnd

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...