processselectionautohotkeymonitorselectall

AutoHotkey: Similar function like ClipWait for "Select All"


Does AutoHotkey have anything similar to "ClipWait" for "Ctrl+A" / "Select All".

Or is there a possibility to get such a function somehow ?


Solution

  • Would this be sufficient?

    ^b::
        send ^a
        selectionWait()
        msgbox, All has been selected
    return
    
    selectionWait() {
        clipboardSave := clipboardAll
        loop {
            send ^c
            if(clipboard != clipboardSave)
                if(clipboard != "")
                    break
        }
        clipboard := clipboardSave
    }
    

    ctrl+c IS fired before everything is selected, but this is on purpose. the action will be repeated until the clipboard contents have changed, and the clipboard will be reset to the previous value afterwards