0
votes

i am trying to build a AutoHotKey that has a blank at the end. But i don't get the idea how to achieve it. Documentary doesn't help me neither. Tried " " and `t without results i seek.

The result should be this String: "2016-02-03 : "

My Script:

$F12::
SetTitleMatchMode, 2
FormatTime, xx,, yyyy-MM-dd : " "; This is one type of the date format
SendInput, %xx%
Return

This is from the documentary "Ending Characters":

Unless the asterisk option is in effect, you must type an ending character after a hotstring's abbreviation to trigger it. Ending characters initially consist of the following: -()[]{}':;"/\,.?!nt (note that n is Enter,t is Tab, and there is a plain space between n andt). This set of characters can be changed by editing the following example, which sets the new ending characters for all hotstrings, not just the ones beneath it:

Hotstring EndChars -()[]{}:;'"/\,.?!nt

Can anyone help my achieve this? Thx

2

2 Answers

1
votes

You can explicitly add the space in the SendInput command.

$F12::
SetTitleMatchMode, 2
FormatTime, xx,, yyyy-MM-dd : " "; This is one type of the date format
SendInput, %xx%{space}
Return
1
votes

Alternatively you can use this syntax:

SendInput, % xx " "

By using a single percent sign in the beginning, text will be interpreted as variables, unless you put it in quotes. Spaces outside of quotes are ignored.
You can optionally put a dot between the variables and strings if you like:

SendInput, % xx . " "

There is also the built in variable A_Space which simply contains a space:

SendInput, % xx . A_Space

or

SendInput, %xx%%A_Space%