我不知道如何打开网站按钮

时间:2019-06-02 09:37:02

标签: autohotkey

我有两个问题,我正在制作一个个人/公共工具,用于在代码中快速找到并打开外部工具的网站(我将在下面提供),我希望按钮上带有文字,该网站,每个网站的链接和名称都位于GUI Stuffs底部的代码中。

我只是不知道如何处理按钮和文本内容,也不知道如何在外部使用chrome打开网站,我知道如何在批处理文件中进行操作,而不是在AHK中

; This is an ED tools Program built to allow you to open tools with a click of a button

Gui, Show, w310 h300, Elite Dangerous Tools

; GUI Stuffs
Gui, Add, Button, w50 19 x150 y10 Beddb













;Tools

;eddb.io
eddb:


return

;-----------

;www.edsm.net
edsm:


return

;-----------

;inara.cz
inara:

return

;-----------

;coriolis.io
coriolis:

return

;-----------

;edtools.ddns.net
edtools:

return

;-----------

;edshipyard.net/
edship:

return

;-----------

GuiClose: 
ExitApp

我想要一个带按钮的GUI,总共6个按钮。两侧各有3个文字,标明了网站名称,无论如何。但是当我现在运行它时,我得到

Error: Invalid Option
Specifically Beddb 

Line#
006 Gui,Add,Button,w50 h19 x150 y10 Bebbd

1 个答案:

答案 0 :(得分:1)

正如Yane在评论中提到的那样,您需要在子例程(标签)名称之前输入g。 (更多信息here。)下面是按钮和站点之一的代码示例。它将在Firefox中打开网站。您可以将其应用于其余的按钮和网站。

f1::
Gui , Add , Button , w50 19 x150 y10 geddb , eddb.io
Gui , Show , w310 h300 , Elite Dangerous Tools
Return

eddb:
Run , firefox.exe "eddb.io"
Return

帮助文档在解释GUI的所有功能方面做得很好。
https://www.autohotkey.com/docs/commands/Gui.htm