mardi 26 juillet 2016

AHK If statement not working

I am trying to compare a number in the title of a pdf document to the number inside the pdf document. I am trying to do this by copying contents to clipboard and then storing that in a variable.

The if statement is not working correctly and all files are being sent to the recycle bin. The code is below. Please let me know how I can fix this.

#SingleInstance, force



Esc::Reload


#d::

Send, {F2}
sleep, 1000
Send, {RIGHT}
sleep, 1000
Send, ^+{LEFT}
sleep, 1000


clipboard =
accountNumOne = 

Send, ^c
ClipWait, 2
sleep, 1000

accountNumOne = clipboard

Send, {Enter 2}
sleep, 2000


mouseclick

Send, {DOWN}
sleep, 1000
Send, ^+{LEFT}
sleep, 1000

clipboard =
accountNumTwo = 

Send, ^c
sleep, 1000
ClipWait, 1
sleep, 1000

accountNumTwo = clipboard

Send,{ALTDOWN}{F4}{ALTUP}


if accountNumOne != accountNumTwo
{   
    sleep, 1000
    Send, {Delete}
    sleep, 1000
    Send, {Enter}
    sleep, 1000
}

else
{
    sleep, 1000
    Send, {DOWN}
}

sleep, 1000

return

Aucun commentaire:

Enregistrer un commentaire