Skip to content

Instantly share code, notes, and snippets.

@AeroNotix
Created March 14, 2012 15:14
Show Gist options
  • Select an option

  • Save AeroNotix/2037155 to your computer and use it in GitHub Desktop.

Select an option

Save AeroNotix/2037155 to your computer and use it in GitHub Desktop.
getItemAt(x, y) {
;; This function gets the text at a location
MouseClick, left, x, y
Send, {HOME}
Sleep, 10
Send, {SHIFTDOWN}{END}{SHIFTUP}
Sleep, 10
Send, {CTRLDOWN}c{CTRLUP}
Sleep, 10
vals = %Clipboard%
return vals
}
insertItemAt(x, y, item) {
;; This function inserts text at a location
MouseClick, left, x, y
Clipboard = %item%
Send, {CTRLDOWN}v{CTRLUP}
}
q::
loop,
{
IfWinExist, Rechnungsbeleg
{
WinActivate
break
}
}
;; Rechnungsbeleg window
InvoiceDate:= getItemAt(157, 226)
Sleep, 50
InvAmount:= getItemAt(157, 268)
Sleep, 50
RefNumber:= getItemAt(391, 230)
Sleep, 50
CurrMarker:= getItemAt(282, 269)
Sleep, 50
TaxAmount:= getItemAt(139, 290)
Sleep, 50
BarCodeNum:= getItemAt(414, 142)
Sleep, 50
BarCodeNum = %BarCodeNum% Storno
;; Eingangsrechnung window
loop,
{
IfWinExist, Eingangsrechnung
{
WinActivate
break
}
}
insertItemAt(169, 223, InvoiceDate)
Sleep, 50
insertItemAt(405, 228, RefNumber)
Sleep, 50
insertItemAt(170, 294, InvAmount)
Sleep, 50
insertItemAt(278, 292, CurrMarker)
Sleep, 50
insertItemAt(157, 312, TaxAmount)
Sleep, 50
insertItemAt(185, 330, BarCodeNum)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment