Awesome! It works now.
Code: Select all
ReopenedClaims:
IniRead, AdjusterIni, GUI.ini
Gui, Reopen:+AlwaysOnTop +LastFound
Gui, Reopen:Default
Gui, Reopen:Font, S8 cBlack Normal, Arial Black
Gui, Reopen:Add, ListView, gReopenBox Grid vAdjusterT w500 h200, Company|Claim
Loop, Parse, AdjusterIni, `n, `r
LV_Add("", A_LoopField, Claim)
LV_ModifyCol()
LV_ModifyCol(1, "Sort CaseLocale")
LV_ModifyCol(1, "Auto")
LV_ModifyCol(2, "AutoHdr")
LV_ModifyCol(2, "Left")
Gui, Reopen:Add, Button, x30 y215 w200 h50 gOpenClaim, Open claim!
Gui, Reopen:Add, Button, x285 y215 w200 h50 gDeleteClaim, Delete claim!
Gui, Reopen:Show, %gui_position% w520 h280, Reserves Pending Authority
Exit
ReopenGuiclose:
Gui, Destroy
Exit
OpenClaim:
ClaimNo := StrSplit(LV_GetSelectedText("2"),"=")
MsgBox % ClaimNo[1]
WinWait, Personal inbox - Google Chrome,
IfWinNotActive, Personal inbox - Google Chrome, , WinActivate, Personal inbox - Google Chrome,
WinWaitActive, Personal inbox - Google Chrome,
Image = SearchBar
ImageClick(Nothing, Image)
Sleep, 50
SendInput, % ClaimNo[1]
Sleep, 50
Image = Search
ImageClick(Nothing, Image)
Exit
DeleteClaim:
ClaimNo := StrSplit(LV_GetSelectedText("2"),"=")
MsgBox % ClaimNo[1]
IniDelete, GUI.ini, %RowText%, % ClaimNo[1]
MsgBox % RowText " " ClaimNo[1] " deleted!"
Exit
ReopenBox:
Gui, Submit, NoHide
if A_GuiEvent = DoubleClick
{
LV_Modify(ActiveRow,"Col2",Content) ; works :)
LV_GetText(RowText, A_EventInfo)
IniRead, ClaimNo, GUI.ini, %RowText%
Loop, Parse, ClaimNo, `n, `r
LV_Modify(A_Index,"", , A_Loopfield)
LV_ModifyCol(2, "Auto" "Left" "Uni")
}
Exit
GuiReopenEscape:
GuiReopenClose:
Gui, Reopen:Destroy
Exit
LV_GetSelectedText(FromColumns="", ColumnsDelimiter="`t", RowsDelimiter= "`n") { ; by Learning one https://autohotkey.com/board/topic/61750-lv-getselectedtext/
if FromColumns = ; than get text from all columns
{
Loop, % LV_GetCount("Column") ; total number of columns in LV
FromColumns .= A_Index "|"
}
if (SubStr(FromColumns,0) = "|")
StringTrimRight, FromColumns, FromColumns, 1
Loop
{
RowNumber := LV_GetNext(RowNumber)
if !RowNumber
break
Loop, parse, FromColumns, |
{
LV_GetText(FieldText, RowNumber, A_LoopField)
Selected .= FieldText ColumnsDelimiter
}
if (SubStr(Selected,0) = ColumnsDelimiter)
StringTrimRight, Selected, Selected, 1
Selected .= RowsDelimiter
}
if (SubStr(Selected,0) = RowsDelimiter)
StringTrimRight, Selected, Selected, 1
return Selected
}