sendEx with smart "send sleep SendText"

Post your working scripts, libraries and tools.
User avatar
hyaray
Posts: 85
Joined: 20 Jun 2015, 01:37
Contact:

sendEx with smart "send sleep SendText"

Post by hyaray » 07 Dec 2022, 04:27

sendEx is not so strictly, but very very usefull.

Code: Select all

send("{tab}")
sleep(100)
SendText("string")

;simplify to
sendEx("{tab}", 100, "string")

sendEx(arr*) {
    for v in arr {
        if (v is integer) {
            sleep(v)
        } else {
            if (v ~= "i)^\{\w+(?: (?:down|up|\d+))?\}") ;case of {ctrl down}|{a 2}|{ctrl up}
                send(v)
            else
                SendText(v)
        }
    }
}

iseahound
Posts: 1434
Joined: 13 Aug 2016, 21:04
Contact:

Re: sendEx with smart "send sleep SendText"

Post by iseahound » 07 Dec 2022, 12:30

You should check \d\d+ so Send 1 won't sleep.

User avatar
hyaray
Posts: 85
Joined: 20 Jun 2015, 01:37
Contact:

Re: sendEx with smart "send sleep SendText"

Post by hyaray » 08 Dec 2022, 19:11

iseahound wrote:
07 Dec 2022, 12:30
You should check \d\d+ so Send 1 won't sleep.
use string will be ok. sendEx("1")

Post Reply

Return to “Scripts and Functions (v2)”