Code: Select all
#NoEnv
#SingleInstance Force
SetWorkingDir %A_ScriptDir%
WinTitle := "Edit Model ‹ Agency — WordPress - Google Chrome:"
Keys := ["#","1","2","3","4","5","6","7","8","9","0"]
for each, key in Keys
DDL_key .= key "|"
Loop, 26
DDL_key .= Chr(A_Index + 64) "|"
DDL_key := SubStr(DDL_key, 1, -1)
Gui, 1: +ToolWindow +AlwaysOnTop
Gui, 1: Add, DropDownList, gCreate_LV_Key vkey Choose1,%DDL_key%
Gui, 1: Show, x0 y0, domains
return
Create_LV_Key:
Gui, 1: Submit, NoHide
GuiControlGet, key
Gui, 2: destroy
Index := ""
text := ""
Loop, Read, linkslist.txt
{
If ((StrLen(A_LoopReadLine) = 1) && (A_LoopReadLine == key))
{
Index := A_Index
break
}
}
Loop, Read, linkslist.txt
{
If (A_Index <= Index)
continue
If (A_LoopReadLine = "")
continue
If (StrLen(A_LoopReadLine) = 1) && (A_Index > Index)
break
text .= A_LoopReadLine "`r`n"
}
Gui, 2: Add, ListView, vLV r10 w400 gMyListView, domain|URL|notes
Gui, 2: default
Loop, parse, text, `r`n
{
If (A_LoopField = "")
continue
If !InStr(A_LoopField, "://")
continue
If (SubStr(A_LoopField, 1, 2) = "- ")
{
domain := "- " . StrSplit(A_LoopField," ").2
URL := StrSplit(A_LoopField," ").3
}
else
{
domain := StrSplit(A_LoopField," ").1
URL := StrSplit(A_LoopField," ").2
}
If InStr(A_LoopField, "(")
{
note := "(" . StrSplit(A_LoopField,"(").2
Gui, 2: ListView
LV_Add("", domain, URL, note)
}
else
{
Gui, 2: ListView
LV_Add("", domain, URL)
}
}
LV_ModifyCol() ; auto-size each column to fit its contents.
Gui, 2: Add, Button, Default, Send
Gui, 2: Show,, Send domain+URL %key%
return
MyListView:
If (A_GuiEvent = "DoubleClick")
{
LV_GetText(domain, A_EventInfo, 1)
If SubStr(domain, 1, 2) = "- "
domain := SubStr(domain, 3)
else
domain := domain
LV_GetText(URL, A_EventInfo, 2)
; MsgBox, domain = "%domain%"`nURL = "%URL%"
WinActivate, %WinTitle%
WinWaitActive, %WinTitle%
SendInput, %domain%%A_Tab%%URL%
}
return
; https://autohotkey.com/docs/commands/ListView.htm#LV_GetNext
ButtonSend:
RowNumber = 0
Loop
{
RowNumber := LV_GetNext(RowNumber)
If (!RowNumber )
Break
LV_GetText(domain, RowNumber, 1)
If SubStr(domain, 1, 2) = "- "
domain := SubStr(domain, 3)
else
domain := domain
LV_GetText(URL, RowNumber, 2)
MsgBox, domain = "%domain%"`nURL = "%URL%"
WinActivate, %WinTitle%
WinWaitActive, %WinTitle%
SendInput, %domain%%A_Tab%%URL%
}
Return
Esc::
GuiClose:
ExitApp