Paste message script

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
airoger
Posts: 4
Joined: 23 Jun 2021, 19:55

Paste message script

23 Jun 2021, 20:01

Hi! Can someone help me to make a script? I want one to paste a message in loop every 120 segs with F1 as toggle button

Code: Select all

F1::
Toggle := !Toggle

    Clipboard := Stored1
    if (ClipPrev = ClipBoard) {
        ToolTip, Nothing selected.
        Sleep, 120000
        Tooltip
        return
    }
    Send, ^v
}
Clipboard := ClipPrev
return
I got this one from a site but I messed up somewhere :( Ty for the help
User avatar
mikeyww
Posts: 26934
Joined: 09 Sep 2014, 18:38

Re: Paste message script

23 Jun 2021, 20:20

Here is one sort of example.

Code: Select all

F1::
SetTimer, Paste, % (on := !on) ? 2000 : "Off"
SoundBeep, 1000 + 500 * on
Return

Paste:
last := Clipboard, Clipboard := ""
Send ^c
ClipWait, 0
Send % (ErrorLevel || Clipboard = last) ? "" : "^v"
Return
airoger
Posts: 4
Joined: 23 Jun 2021, 19:55

Re: Paste message script

23 Jun 2021, 20:43

If I already have the message copied, I need to remove the send ^c part? ty for the help btw!
User avatar
mikeyww
Posts: 26934
Joined: 09 Sep 2014, 18:38

Re: Paste message script

23 Jun 2021, 21:06

Yes, sure. Since you are showing a script fragment, I was just guessing at what you are trying to do.
airoger
Posts: 4
Joined: 23 Jun 2021, 19:55

Re: Paste message script

23 Jun 2021, 21:15

Oh sorry! I was trying to make a script to send a message that I already have copied in my clipboard. I just need the script to press ctrl + v and then "enter" every 120 secs in loop to send a message to a channel. That fragment is one that I got ready-made, but I tried to cut out a part of it and it stopped working
User avatar
mikeyww
Posts: 26934
Joined: 09 Sep 2014, 18:38

Re: Paste message script

24 Jun 2021, 06:34

OK. Could try the following.

Code: Select all

F1::
SetTimer, Paste, % (on := !on) ? 120000 : "Off"
SoundBeep, 1000 + 500 * on
Paste:
Send % on ? "^v{Enter}" : ""
Return
airoger
Posts: 4
Joined: 23 Jun 2021, 19:55

Re: Paste message script

24 Jun 2021, 07:52

It is absolutely PERFECT! No words sir! Thank you very much for your time, it is greatly appreciated :D

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: jaka1, mikeyww, ReyAHK, Rohwedder and 307 guests