Auto-replacement text

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Gabby
Posts: 28
Joined: 19 Aug 2017, 03:55

Auto-replacement text

20 Aug 2017, 04:43

I'm currently using the following code for a hotstring:

:*:d1``::
VV := Date_now(1)
Send %VV%
return

Is there anyway to make this a one liner? For example like the following:
:*:d1``:: Date_now(1)

Andrew
SirRFI
Posts: 404
Joined: 25 Nov 2015, 16:52

Re: Auto-replacement text

20 Aug 2017, 18:09

Create a custom Function, like this:

Code: Select all

F1::CustomFunction("Auto")
F2::CustomFunction("I am a ")

CustomFunction(Txt)
{
	Txt .= "Hotkey"
	MsgBox % Txt
}
Use

Code: Select all

[/c] forum tag to share your code.
Click on [b]✔[/b] ([b][i]Accept this answer[/i][/b]) on top-right part of the post if it has answered your question / solved your problem.
Gabby
Posts: 28
Joined: 19 Aug 2017, 03:55

Re: Auto-replacement text

20 Aug 2017, 19:17

Yes that works with a hotkey, but not a hotstring like the example I posted. A
obeeb
Posts: 140
Joined: 20 Feb 2014, 19:15

Re: Auto-replacement text

20 Aug 2017, 20:00

From Hotstring:
The "by the way" example above is known as an auto-replace hotstring because the typed text is automatically erased and replaced by the string specified after the second pair of colons.
By contrast, a hotstring may also be defined to perform any custom action as in the following examples.
Note that the commands must appear beneath the hotstring:

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: SimmoF, uchihito and 220 guests