[AHK#52] 1.1.28新功能:Function Hotstring
2022-7-10 22:19:15 Author: jdev.tw(查看原文) 阅读量:29 收藏

3C設備

作者的敗家記錄,包含iPad、Nexus 7、Galaxy S3等iOS與Android相關電腦設備,也有中華電信ADSL網路與NAS設備等之應用技巧。

Windows學習誌

聚焦於Windows作業系統各個版本的使用經驗與操作技巧,有Windows XP、Windows Vista、Windows 7、Windows 8與Windows Server等不同版本。

檔案、資料夾管理

日常使用電腦時有很大的比例是在操作檔案與資料夾,在此分類裡作者介紹了增進作業效率的各式技巧與心得分享。

生產力工具

與工作效提升有關的各式工具、網站服務,例如Toodledo、Evernote、Google各式服務等之經驗分享。

閱讀筆記

作者於網站衝浪之際,特別轉貼有所感的文章,內容不限電腦科技,尚有不少人文社經之作。

首頁 » AutoHotkey鍵盤工具

作者: 日期: 2022/07/10 – 22:19:15尚無留言 | 瀏覽數: 2 / 2

原來AutoHotkey自從1.1.28版開始已經提供了稱為Function Hotstrings的功能了,簡單理解就是能在熱字串裡寫腳本程式碼了。
另外,也可以使用Hotstring函數動態控制熱字串。

1. 範例

#SingleInstance Force

; This example also demonstrates one way to implement case conformity in a script.
:C:BTW::  ; Typed in all-caps.
:C:Btw::  ; Typed with only the first letter upper-case.
: :btw::  ; Typed in any other combination.
  btw() {
    hs := A_ThisHotkey  ; For convenience and in case we're interrupted.
    if (hs == `":C:BTW")
      Send BY THE WAY
    else if (hs == ":C:Btw")
      Send By the way
    else
      Send by the way
    }

::tst::
  SendInput #e
  return

::aa:: Hotstring(": :btw", "new BTW string")
::bb:: btw()
::cc:: 
  btw()
  return

::dd::
  try
    Hotstring("::btw", " bb tt ww")
  catch
    MsgBox The hotstring does not exist or it has no variant for the current IfWin criteria.
  return

相關鏈接

✅ Function Hotstrings: https://www.autohotkey.com/docs/Hotstrings.htm#Function
✅ Hotstring: https://www.autohotkey.com/docs/commands/Hotstring.htm

教學影片

##

您可能也會有興趣的類似文章

標籤:


文章来源: http://jdev.tw/blog/7188/autohotkey-function-hotstring
如有侵权请联系:admin#unsafe.sh