I have read the many other forum posts but what I am wanting to do is the following:
Read the contents of my clipboard already stored before this script is executed and based on the contents of the clipboard, use an if statement to then....(do anything really)
I tried using a single variable :=clipboard and then use that variable in the if else statement, but that did not work.
I then tried to assign that variable to another variable and that did not work either.
Any help would be greatly appreciated.
What I have figured out but do not want to use is a clear clipboard at the begging and copy contents again, I want to use what is in the clipboard already so that when this program is executed, it is just referencing what is already there.
Thanks,
-Alex
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
sleep, 300
pageN := clipboard
sleep, 300
sleep, 150
If (pageN == "apple")
MsgBox You found a fruit.
Else If (pageN == "carrot")
MsgBox You found a vegetable
Else
MsgBox, You found something else
Return
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
sleep, 300
pageN := clipboard
sleep, 300
var1 == %pageN%
sleep, 150
If (var1 == "apple")
MsgBox You found a fruit.
Else If (var1 == "carrot")
MsgBox You found a vegetable
Else
MsgBox, You found something else
Return