Sign in to follow this  
Followers 0
Eambo

Best way to execute this

3 posts in this topic

Hi Everyone!

This is more a fact gathering/brain storming post than anything. I have written a short script that'll allow me to automatically copy highlighted text to clipboard. Simples!

What I'm wondering is: Is there a more efficient way of doing this?

I noticed sometimes it wouldn't copy, and I'm thinking due to too much looping. But I could also be crazy? Does anyone have any insight or suggestions on how this could be better implemented?

Nothing urgent or major, I'd just be interested to know how I could do things better :-)

#Include <Misc.au3>

call ("_Start")


Func _Start()
    While not _IsPressed("01") 
        Sleep (20)
WEnd
_Clicked()
EndFunc

Func _Clicked()
    $Count=0
    While(_IsPressed("01") = 1 And $Count < 2)
        $Count += 1
        Sleep(500)
        WEnd
        If $Count=2 Then
            Send ("^c")
            Call ("_Start")
        EndIf
        _Start()
        EndFunc

Share this post


Link to post
Share on other sites



Probably you can use rather than trying to catch mouse events by looping.

Share this post


Link to post
Share on other sites

What's the utility of your script ? Posted Image

You should use _Start () instead of call ("_Start")


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
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
Sign in to follow this  
Followers 0