I am running my code, once it hits the #Include the findtext gui pops up. My program does not run. I try closing it while program is running, nothing
This is strange because i have run the program many times and this was not happening. Anyone have this happen to you?? Please help
Code: Select all
#Include C:\Users\tpitera\Downloads\AHK\Chrome.ahk-master\Chrome.ahk
#Include C:\Users\tpitera\Downloads\AHK\FindText.ahk
;#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.
;connect to chrome
FileCreateDir, ChromeProfile
ChromeInst := new Chrome( A_ScriptDir "\ChromeProfile")
; --- Connect to the page ---
if !(PageInst := ChromeInst.GetPage())
{
MsgBox, Could not retrieve page!
ChromeInst.Kill()
}
else
{
; --- Navigate to the desired URL ---
PageInst.Call("Page.navigate", {"url": "https://erp.i-techcloud.com/MCS/Frames/Login.aspx?ReturnUrl=%2fMCS%2fMain%3fScreenId%3dGI000113&CompanyID=MCS"})
PageInst.WaitForLoad()
;; login to Acumatica
PageInst.Evaluate("document.getElementById('txtUser').value = 'tap';")
PageInst.Evaluate("document.getElementById('txtPass').value = 'Nwfi9].|';")
PageInst.Evaluate("document.getElementById('cmbCompany').value = 'MCS';")
PageInst.Evaluate("document.getElementById('btnLogin').click();")
Sleep, 5000 ;sometimes computer lags
;verify if on data views tab, release cases
Text:="|<>*152$71.000000000000Ts00E0000000UQ00U00000010M01000000020E02000000040Uw47UT1w3k833A8NVb6AQkTwAAFVa288UUVUM8W304M31V1UUFA60sS6321VzmTwTkDDy43204E1UU3M083628Um344EN"
if !(ok:=FindText(X, Y, 259-150000, 139-150000, 259+150000, 139+150000, 0, 0, Text))
{
FindText().Click(X, Y, "L") ;checks for word releases
}
Sleep, 2000
Text:="|<>*191$47.3k0003TUMk0006lUk7XVkBV109hakP320DQ8Uq640qSz1gAA3ACU3MEMqP9g6lUD7nlkBy000000008"
if (ok:=FindText(X, Y, 956-150000, 542-150000, 956+150000, 542+150000, 0, 0, Text))
{
FindText().Click(X, Y, "L")
}
MouseClick, Left, 412, 339 ;click sort decending
Sleep, 5000
Text:="|<>*152$35.0000000000000000000000000000000000007U0000EU0003zk00080E000E0U000U101z10201w20401k40800080E000E7U000UH00010g00021k0003z000000000000000000000000001"
if (ok:=FindText(X, Y, 959-150000, 543-150000, 959+150000, 543+150000, 0, 0, Text))
{
FindText().Click(X, Y, "L") ;click copy symbol
}
Sleep, 2000
Text:="|<>*189$59.000000000000000000000000000000000000000000000000000000000000S0000000012003k0000Dz00Ak0000U100kk0001020107Xn42040209aGM408040l8oU80E081WFh0E0U0MP4XC0U100MWNYM10S00S7Xkk21A000041U42k00008208700000EA0Dw00000000000000000000000000000000000000000000001"
if (ok:=FindText(X, Y, 957-150000, 542-150000, 957+150000, 542+150000, 0, 0, Text))
{
FindText().Click(X, Y, "L") ;click copy in dropdown
}
Sleep, 2000
Text:="|<>*165$26.000000000000001U000M00060001U000M0006001zzU0Tzs0060001U000M00060001U000M00000000008"
if (ok:=FindText(X, Y, 960-150000, 543-150000, 960+150000, 543+150000, 0, 0, Text))
{
FindText().Click(X, Y, "L") ;click plus (Add new record)
}
Sleep, 2000
Text:="|<>*152$35.0000000000000000000000000000000000007U0000EU0003zk00080E000E0U000U101z10201w20401k40800080E000E7U000UH00010g00021k0003z000000000000000000000000001"
if (ok:=FindText(X, Y, 959-150000, 543-150000, 959+150000, 543+150000, 0, 0, Text))
{
FindText().Click(X, Y, "L") ;click copy symbol again
}
Sleep, 2000
Text:="|<>*179$59.0s00000000zTU00000018900z00002Tm01300204040220040808044QSQsE0E08N4YG8U0U0TU90YF0zU0U7llDm110108UGE422020H8YW844040uSAwE880000000UEE0000001zUU00000001z00000008"
if (ok:=FindText(X, Y, 960-150000, 543-150000, 960+150000, 543+150000, 0, 0, Text))
{
FindText().Click(X, Y, "L") ;click paste
}
Sleep, 2000
*** MouseClick, Left, 514, 346 ;click subject textbox
Send ^a ;select all
Send Magnum SW V%NewVersionNum%
MouseClick, Left, 45, 468 ;click details box
Send %VersionCtrlText%
*** MouseClick, Left, 298, 397 ;Click Attributes
if(ReleaseChoice = "Beta")
{
MouseClick, Left, 243, 496 ;Click Release checkbo to uncheck
MouseClick, Left, 245, 526 ;Click Beta
}
MouseClick, Left, 258, 581, 2 ;double click to change version
Send %NewVersionNum%
Text:="|<>*141$20.000000000000000000000000Ty0+6k2Ve0c2E/zY2010U0E8042010byE90Y2E90Y2E7zs00000000000008"
if (ok:=FindText(X, Y, 960-150000, 543-150000, 960+150000, 543+150000, 0, 0, Text))
{
FindText().Click(X, Y, "L") ;find and click save
}
MouseClick, Left, 416, 388 ;click activities
MouseClick, Left, 294, 434 ;click add email
}