Hotstring one-liner with expression Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
zxw
Posts: 2
Joined: 25 Mar 2023, 14:46

Hotstring one-liner with expression

Post by zxw » 25 Mar 2023, 14:56

Hi! Can you please tell me if I can have a hotstring one-liner for a text insertion, using some expressions. It seems that I can do it for a hotkey, but for a hotstring I have to use a code block. Or maybe I do something wrong, of course, just starting to learn Autohotkey. Thanks!

Code: Select all

^t::SendText(FormatTime(,"HH:mm"))     ; ok

:*:tt!::
{ SendText(FormatTime(,"HH:mm"))       ; ok
}

:*:tx!::SendText(FormatTime(,"HH:mm")) ; no

cat dog fox war
Posts: 38
Joined: 15 Mar 2023, 10:18

Re: Hotstring one-liner with expression  Topic is solved

Post by cat dog fox war » 25 Mar 2023, 22:42

https://www.autohotkey.com/docs/v2/Hotstrings.htm#Options

you need x Options

Code: Select all

:*x:tt!:: SendText(FormatTime(,"HH:mm"))

zxw
Posts: 2
Joined: 25 Mar 2023, 14:46

Re: Hotstring one-liner with expression

Post by zxw » 26 Mar 2023, 04:38

Yes, thank you. I've found it too -- viewtopic.php?t=65134

Post Reply

Return to “Ask for Help (v2)”