Jump to content

autoit want this monitor


Recommended Posts

I like to do autoit detects select text with the mouse or keyboard?

I want to make a program that when you highlight a text then appears automatically a window that has buttons to copy and paste to the clipboard or translated into google.

Link to comment
Share on other sites

..maybe something that gets mouseDown's X:Y and , of mouseUp X:Y , if one is too far from the prior, send a Ctrl+C, ..that way you can do it.
Nope, I'm not gonna write it :P

But that is the idea B)

And welcome to the forums ;) , hope you learn this language, is quite rewarding.

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

I do not remember who to thank sincerely for this, but I use it in various scripts, it works like a charm:

Func _GetTextFromActiveWindow()

    ;Get window title, in case we need it
    $window_title = WinGetTitle("[active]")

    If $window_title == "" Then
        Beep(600, 1000)
        Exit
    EndIf

    WinActivate($window_title)

    ClipPut("") ;Clear the clipboard, so we can check for data when we write to it
    $readtext = "" ;We'll put new clipboard data in this variable

    For $i = 1 To 8 Step 1

        $rand = Random(1, 4, 1)

        Send("{CTRLDOWN}")
        ;Try various methods until we get text on the clipboard
        Switch $rand
            Case 1
                Send("{INS}")
            Case 2
                ControlSend($window_title, "", "", "{INS}")
            Case 3
                Send("c")
            Case 4
                ControlSend($window_title, "", "", "c^")
        EndSwitch

        Send("{CTRLUP}")
        $readtext = ClipGet() ;Any text on the clipboard?
        If $readtext <> "" Then
            Return $readtext
        EndIf

        If $i = 4 Then
            WinActivate($window_title)
            Sleep(100)
        EndIf

    Next
    Sleep(2000)
    Return $readtext

EndFunc   ;==>_GetTextFromActiveWindow

 

Edited by t0nZ
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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...