%clipboard% not working?

Get help with using AutoHotkey and its commands and hotkeys
pompom2500
Posts: 1
Joined: 05 Sep 2019, 17:25

%clipboard% not working?

05 Sep 2019, 17:44

I'm trying to make a script that search for specific lines in text and then search in another file if it already have it. I'm having a problem at the "%clipboard%" part, the script just stops, I've seen clipboard used between "%" in other scripts, I don't understand why it wouldn't work in this case, any idea why? Thanks in advance.

Code: Select all

F9::

IfWinExist, WorkFile
    WinActivate
Sleep, 1000
Send ^f
Sleep, 1000
Send <NOTES>
Sleep, 1000
Send {Enter}
Sleep, 1000
Send {Escape}
Sleep, 1000
Send {Home}
Sleep, 1000
Send +{End}
Sleep, 1000
Send ^c
Sleep, 1000

Haystack := FileOpen( "C:\Results.txt", "r").Read()
Needle := %clipboard%                <<----------------------------------  Error!

if IfNotInString,( Haystack, Needle )
{
IfWinExist, Results
    WinActivate
Sleep, 1000
SendInput %CurrentDateTime%
Sleep, 1000
Send {Space}
Sleep, 1000
Send ^v
Sleep, 1000
Send {Enter}
Sleep, 1000
Send ^s
Sleep, 1000
Return
}
else
    SoundPlay, C:\Windows\Media\Windows Ding.wav
Return
User avatar
Xtra
Posts: 1458
Joined: 02 Oct 2015, 12:15

Re: %clipboard% not working?

05 Sep 2019, 18:37

For Expression syntax use:
Needle := clipboard

Return to “Ask For Help”

Who is online

Users browsing this forum: Google [Bot], Mike_Fay, nitrofenix, TheMainEvent and 58 guests