Trying to create ahk with drop down list to open internet links (for company). As I created, noticed errors and mistake, that I cannot fix it. First it runs whole script and I have around 80 links, and for the last one I have to wait 80 seconds to open it, secondly sometimes in show hidden icons area it opens multiple ahk scripts...
As well I tried to go with function Run, msedge.exe "https://mail.google.com/" " --new-window"
- but it cuts half of the link, and it does not work... so I came up with clipboard + paste. Maybe someone could help me in this case where do I make mistake? AHK version 1.1.35.00
尝试创建下拉列表打开互联网链接(公司)的ahk。当我创建,注意到错误和错误,我无法修复它.首先它运行整个脚本,我有大约80个链接,最后一个我必须等待80秒才能打开它,其次有时在显示隐藏图标区域它打开多个ahk脚本.以及我试图去与功能运行,msedge.exe“https://mail.google.com/““--新窗口”-但它削减了一半的链接,它不工作.所以我想出了剪贴板+粘贴。也许有人可以帮助我在这种情况下,我犯了什么错误?AHK版本1.1.35.00
Gui, +AlwaysOnTop
; DropDownList:
; Gui, Add, DDL, gAction vChoice Choose1 w200, Page one|Page two| Page three| Page four
; ListBox:
Gui, Add, ListBox, gAction vChoice w200 h60, one|two|three|four
return
; Press F1 to show the gui:
F1::
CoordMode, Mouse, Screen
MouseMove, 40, 50, 0
Gui, Show, x0 y0, Actions
return
Action:
Gui, Submit ; or
if (Choice = "Page one")
Run, msedge.exe
Sleep 1000
clipboard := "page link"
Send ^v
Send {enter}
if (Choice = "Page two")
Run, msedge.exe
Sleep 1000
clipboard := "page link"
Send ^v
Send {enter}
if (Choice = "Page three")
Run, msedge.exe
Sleep 1000
clipboard := "page link"
Send ^v
Send {enter}
if (Choice = "Page four")
Run, msedge.exe
Sleep 1000
clipboard := "page link"
Send ^v
Send {enter}
return
GuiClose:
ExitApp
更多回答
优秀答案推荐
Try this:
试试这个:
; Replace all % by `% in the web addresses
My_Webpages =
(
autohotkey questions - Stackoverflow | https://stackoverflow.com/questions/tagged/autohotkey
windows-10 questions - Stackoverflow | https://stackoverflow.com/questions/tagged/windows-10
command-line questions - Stackoverflow | https://stackoverflow.com/questions/tagged/command-line
)
Loop, parse, My_Webpages, `n
{
page_name := StrSplit(A_LoopField," | ").1
list .= page_name "|"
}
Gui, +AlwaysOnTop
Gui, Add, DDL, gAction vChoice w300 h60, % list
Gui, Show, x0 y0, Web pages
return
Action:
Gui, Submit, NoHide
Loop, parse, My_Webpages, `n
{
If InStr(A_LoopField, Choice)
{
page := StrSplit(A_LoopField," | ").2
Run, msedge.exe "%page%" --new-window"
break
}
}
return
GuiClose:
ExitApp
Make sure that all percent signs (%) in the web addresses are escaped (`%).
确保网址中的所有百分号(%)都已转义(`%)。
更多回答
我是一名优秀的程序员,十分优秀!