Forum Overview
::
Still Life
::
(source)
[quote name="Fullofkittens"][quote]caltropsSubject := "Test AutoHotKey message{.}{.}{.}" caltropsMsg := "This is a test message; if this worked then AutoHotKey is actually pretty easy to use. Thanks Ray{!}" clickImage(imagePath) { Loop { imagesearch, foundX, foundY, 0, 0, 1280, 800, %imagePath% ; msgbox %foundX% if (foundX <> "") { break } } ; ends Loop inside clickImage click %foundX%, %foundY% } ; ends clickImage Run www.caltrops.com clickImage("C:\Documents and Settings\Clint\Desktop\AHK Images\caltrops2_13.gif") Sleep, 1000 Send ^f Send Still Send {Enter} Send {Esc} Sleep, 500 Send {Enter} Sleep, 2000 Send ^f Send tying Send {Enter} Send {Esc} Sleep, 500 Send {Enter} clickImage("C:\Documents and Settings\Clint\Desktop\AHK Images\pointy-default-replybutton.gif") Loop { imagesearch, foundX, foundY, 0, 0, 1280, 800, C:\Documents and Settings\Clint\Desktop\AHK Images\pointy-default-title.gif ; msgbox %foundX% if (foundX <> "") { break } } foundX += 100 foundY += 10 click %foundX%, %foundY% Send ^a Send %caltropsSubject% Send {Tab 2} Send %caltropsMsg% clickImage("C:\Documents and Settings\Clint\Desktop\AHK Images\pointy-default-previewbutton.gif") msgBox, 4, Did it work?, Click Yes if it worked and No if it didn't. ifMsgBox No WinClose, Caltrops - Still Life - Compose ifMsgBox Yes clickImage("C:\Documents and Settings\Clint\Desktop\AHK Images\pointy-default-postbutton.gif") [/quote] Holy shit it is driving me CRAZY by not deferencing variables the same way that VBscript does. But learning how to do this only took me like 2 hours so it is definitely faster to learn than Python. Does it have some way of identifying links I want to click that is simpler than what I have done here? The tool I'm accustomed to has an Object Repository that lets you set up identifying characteristics for all the "test objects" you want to use, which is nice because visual elements are usually subject to change. Is there any way I can, like, use the image name rather than a comparison?[/quote]