Code: Select all
If (Open1 = 1)
{
if WinExist("Finale")
{ coordmode, pixel, window
WinActivate
Sleep 200
WinMaximize
Sleep 200
WinGetPos, finalewindowx, finalewindowy, finalewidth, finaleheight, Finale
PixelSearch, SalesLogox, SalesLogoy, finalewindowx, finalewindowy, finalewidth, finaleheight, 0xACD360, 3, Fast RGB
MouseMove, SalesLogox, SalesLogoy, 0
MouseMove, 48, 25, 2, r
Click, 2
Sleep 200
Send ^c ;copy order number
Sleep 200
;OrderNumber := ClipBoard
OrderNumber := RegExReplace(Clipboard,"[a-zA-Z,$\h]")
msgbox, 4, Is this your order number?, %ordernumber%
IfMsgBox No
Return
Else
send ^{home}
sleep 200
Send ^a
sleep 200
send ^c ; this text remains in the clipboard even after attempting to copy text further down in the script
sleep 200
Pos:=1 ;set starting position
Pos_Found:=RegExMatch(ClipBoard,"i)(?:[\w_0-9\.-]+)@(?:[\w\.-]+)\.(?:[a-z_0-9\.]{2,6})",bcorderemail)
SearchBigCommerce := "microsoft-edge:https://store-dl52lpq.mybigcommerce.com/manage/orders/search/results?advancedSearch=true&keywords=" . bcOrderEmail . "&sortField=orderid&sortOrder=desc&searchByDate=0&orderTo=" . OrderNumber . "&orderFrom=" . OrderNumber . "&searchDeletedOrders=no&preOrders=0,1"
Run %SearchBigCommerce%
Sleep 3000
;the section below works when run by itself, but not in conjunction with the code above
#include findtext.ahk
t1:=A_TickCount, bcfind1:=X1:=Y1:=""
bcfind1:="|<emailsign>*214$20.0000000zzw801300kk0AD0D2M6EX348TV21UEU048013zzk0000008"
if (ok:=FindText(X1, Y1, -1461-150000, 551-150000, -1461+150000, 551+150000, 0, 0, bcfind1))
{
FindText().Click(X1, Y1, "L")
}
mousegetpos, xpos1, ypos1
#include findtext.ahk
t1:=A_TickCount, bcfind2:=X2:=Y2:=""
bcfind2:="|<manualtaxsign>*219$20.0003zw1U3UE0w40BV03AHaTZd1tOk2Kf0Yps91G2EaUY8k9002M01Xzzk000U"
if (ok:=FindText(X2, Y2, -1462-150000, 845-150000, -1462+150000, 845+150000, 0, 0, bcfind2))
{
FindText().Click(X2, Y2, "L")
}
mousegetpos, xpos2, ypos2
mouseclickdrag left, xpos1, ypos1,xpos2, ypos2, 2
sleep 100
sendinput {ctrl down}c{ctrl up}
msgbox %clipboard%
return