AutoHotkey

維基百科,自由的百科全書
跳至導覽 跳至搜尋
AutoHotkey
File:AutoHotkey logo.png
開發者Chris Mallett(Chris),Steve Gray(Lexikos)
首次發佈2003年11月10日 (2003-11-10)
目前版本
    Module:EditAtWikidata第29行Lua錯誤:attempt to index field 'wikibase' (a nil value)
    原始碼庫
    • {{URL|example.com|可选的显示文本}}
    Module:EditAtWikidata第29行Lua錯誤:attempt to index field 'wikibase' (a nil value)
    程式語言C++
    引擎
      Module:EditAtWikidata第29行Lua錯誤:attempt to index field 'wikibase' (a nil value)
      作業系統Microsoft Windows
      語言英語
      類型手稿語言自動化GUI
      許可協定GPL
      網站www.autohotkey.com

      AutoHotkey自由開源的程式語言,常用於Windows平台的自動化。[1]

      AutoHotkey 能快速編寫的功能[編輯]

      • 啟動程式,打開檔案
      • 獲得或產生系統狀態,音量(狀態,調節),搜尋螢幕上的圖像或像素(獲得坐標),滑鼠(位置,懸停視窗對象,移動),鍵盤(熱鍵(快捷鍵),熱字串(鍵盤輸入序列),上下文熱鍵),遊戲杆按鈕
      • 建立圖形化使用者介面
      • 剪貼簿操作,程式窗口操作

      歷史[編輯]

      AutoHotkey Basic時期,官方網站為www.autohotkey.com頁面存檔備份,存於互聯網檔案館)。當Chris Mallett(原作者)停止更新時宣佈AutoHotkey_L為後續主分支。[2]不久網站轉由polyethene管理,他對網站的決定與討論區中許多核心用戶出現較大分歧[3][4]且不時失去聯絡並成立了公司確保其正常運營。[5][6][7]2014年4月成立了 AutoHotkey Foundation 以確保AutoHotkey自由開放、持續開發,並提供組織、法務和財政上的支援。[8]

      版本歷史[編輯]

      • AutoHotkey Basic:Chris Mallett 提議在AutoIt v2中整合熱鍵支援未得到AutoIt社群響應後,於2003年11月10日公開發布了AutoHotkey的首個測試版本。[9][10][11]作者以AutoIt v2的語法為基礎並在一些命令和編譯器中使用AutoIt v3的原始碼開始編寫自己的程式。[12]隨後,AutoIt v3的許可從GPL切換為閉源,作者給出的原因是「某些專案重複竊取AutoIt的代碼」和「建立了競爭者」。[13]
      • AutoHotkey_L:2010年10月10日,原作者在停止更新一年多後表示「失去了興趣」並聲明AutoHotkey_L為正在開發的分支,並把它放置在網頁的下載部分的前面。[14]同時把原來的版本稱為 AutoHotkey Basic。[15]比起AutoHotkey Basic,AutoHotkey_L中增加了UnicodeCOM對象除錯特性和其他功能。[16]

      主要分支[編輯]

      • AutoHotkey 1.0.* - 被稱為 AutoHotkey Basic 或者 AutoHotkey Classic 或者 AutoHotkey Vanilla[17]
      • AutoHotkey_H[18] 是由 HotkeyIt 合併了原有AutoHotkey.dll 並在 AutoHotkey_L 及 AutoHotkey v2 的基礎上開發的分支。
      • AutoHotkey_L 主要由 Lexikos 在 AutoHotkey Basic 基礎上開發的分支[16],但是現在已經變成(也被稱為) AutoHotkey 1.1.*頁面存檔備份,存於互聯網檔案館) 的主要版本。[17]
      • AutoHotkey v2[19] 由 Lexikos 基於AutoHotkey_L代碼開發,已於2022年12月20日正式發佈,語法不完全相容 AutoHotkey_1.1.*。[20][21]2023年1月22正式成為官方的默認版本。[1]頁面存檔備份,存於互聯網檔案館

      應該選擇哪個版本[編輯]

      AutoHotkey 1.0.* 和 AutoHotkey_H 已停止開發和維護,不建議使用。

      依賴大量舊的代碼庫建議使用 AutoHotkey 1.1.*,因為目前絕大多數的代碼和社區都是使用這個版本,這個版本仍在維護,仍然會添加少量的新功能和修復錯誤,用戶可以等待遷移工具完善或者 v2 變成主流再遷移即可。

      不依賴舊的代碼庫,願意且能夠同步改動代碼的用戶使用 AutoHotkey v2,能獲得更一致的語法和更多的新功能。另外從v2 beta 4版本開始,v2和v1.1可以在同一台電腦上共存,v2 beta 15 已能自動從代碼來決定以哪個版本的引擎來運行,也有提供安裝工具,無需手動編譯或設定。

      常用的輔助工具[編輯]

      • 中文和英文文件[22][23]
      • Window Spy(內建):獲得當前窗口或控制項的進程的介面細節。
      • ahk2exe(Convert .ahk to .exe)(內建):指令碼編譯器,把 ahk 指令碼轉換成可執行檔案。
      • SciTE4AutoHotkey頁面存檔備份,存於互聯網檔案館):基於 SciTE 的代碼編輯器,功能包含語法突顯、自動補全、一鍵運行指令碼、GUI 工具等。
      • GUI Creator[24]:在圖形介面中為AutoHotkey指令碼建立GUI的工具。
      • Pulover's Macro Creator[25]:圖形化宏錄製工具和自動化工具。
      • iWB2 Learner[26]:從IE中取得網頁元素資訊的工具,編寫COM自動化操作IE的工具。
      • VSCode 上的相關外掛程式:提供語法突顯,文件格式化等功能。

      代碼範例[編輯]

      快捷鍵(熱鍵)

      讓左邊的 ⊞ Win鍵失效

      LWin::Return
      

      搜尋剪貼簿的內容

      Alt & g::Run http://www.google.com/search?q=%clipboard%
      

      熱字串(序列鍵)[27]範例:依次按下wjbk 輸入維基百科

      ::wjbk::维基百科,自由的百科全书
      

      按下rn 打開記事本

      ::rn::Run, Notepad
      

      另請參閱[編輯]

      參考資料[編輯]

      1. ^ Prevent RSI with AutoHotkey. cedeq.com. [2014-03-02]. (原始內容存檔於2014-03-02). 
      2. ^ Chris. My status and website changes. AutoHotkey.com. [2014-06-15]. (原始內容存檔於2014-10-09). 
      3. ^ polyethene. Changes for AutoHotkey website. AutoHotkey.com. [2014-06-15]. (原始內容存檔於2014-10-09). 
      4. ^ sumon. Make AHK_L "main" version?. AutoHotkey.com. [2014-06-15]. (原始內容存檔於2014-07-14). 
      5. ^ tidbit. Basics as to why AHKSCRIPT exists. ahkscript.com. [2014-06-15]. (原始內容存檔於2014-07-27). 
      6. ^ The AutoHotkey Foundation. ahkscript.org. [2014-06-15]. (原始內容存檔於2014-06-25). 
      7. ^ tank. Welcome and if you need help. ahkscript.org. [2014-06-15]. (原始內容存檔於2014-07-14). 
      8. ^ The AutoHotkey Foundation. ahkscript.org. [2014-06-29]. (原始內容存檔於2014-06-25). 
      9. ^ Author Chris Mallett's post on the AutoHotkey Forums. Autohotkey.com. [2011-12-02]. (原始內容存檔於2008-02-18). 
      10. ^ An AutoIt / AutoHotkey nonfunctional comparison. Paperlined.org. [2011-12-02]. (原始內容存檔於2011-12-08). 
      11. ^ AutoHotkey Changelog for Years 2003-2004. Autohotkey.com. [2011-12-02]. (原始內容存檔於2011-11-04). 
      12. ^ Author Chris Mallett's post on the AutoHotkey Forums. Autohotkey.com. [2011-12-02]. (原始內容存檔於2008-05-26). 
      13. ^ Licensing Opinions - AutoIt Forums. Autoitscript.com. [2011-12-02]. (原始內容存檔於2019-09-19). 
      14. ^ Forum post by Chris, announcing AutoHotkey_L now main platform. Autohotkey.com. [2011-12-02]. (原始內容存檔於2019-09-19). 
      15. ^ Download page showing AutoHotkey_L as ongoing platform. Autohotkey.com. [2011-12-02]. (原始內容存檔於2011-12-01). 
      16. ^ 16.0 16.1 AutoHotkey_L的新增特性. ahkcn.sourceforge.net. [2011-12-28]. (原始內容存檔於2014-10-09). 
      17. ^ 17.0 17.1 AutoHotkey Downloads. (原始內容存檔於2020-07-02). 
      18. ^ HotKeyIt. AutoHotkey_H. autohotkey.net. [2014-06-16]. 
      19. ^ AutoHotkey v2. ahkscript.org. [2014-06-15]. (原始內容存檔於2014-07-09). 
      20. ^ AutoHotkey v2 Development. ahkscript.org. [2014-06-15]. (原始內容存檔於2014-07-14). 
      21. ^ v2-changes. www.autohotkey.com. [2020-08-19]. (原始內容存檔於2020-04-09). 
      22. ^ ahk 英文文檔. (原始內容存檔於2019-10-01). 
      23. ^ ahk 中文文檔. (原始內容存檔於2019-10-13). 
      24. ^ maestrith. GUI Creator. ahkscript.org. [2014-06-16]. (原始內容存檔於2014-06-25). 
      25. ^ Pulover's Macro Creator. macrocreator.com. [2014-04-08]. (原始內容存檔於2014-04-08). 
      26. ^ iWB2 Learner页面. [2014-04-22]. (原始內容存檔於2014-04-18). 
      27. ^ 热字串和自动替换. AutoHotkey中文幫助. ahkcn.sf.net. [2014-06-16]. (原始內容存檔於2014-06-03). 

      外部連結[編輯]