如何检测用户是否写了特定的句子?

How to detect if a user writes a specific sentence?

所以,我想检测用户是否在键盘上写了一个特定的句子,如果是,则执行一个功能。

例如,如果用户写:

if user types /hello

脚本激活例如输出

Send, Hello. How are you today?

根据 Hotstrings 的文档,您的示例如下所示:

::if user types /hello::Send, Hello. How are you today?

不过,这需要输入额外的 "ending character",例如 space 或制表符来触发转换。

立即替换输入最后一个字符后添加的文本 * option:

:*:if user types /hello::Send, Hello. How are you today?