Kinda embarrassed to be asking this after many, many years of using AHK, but how do I send trailing spaces with the Send command?
Here's the two lines of code:
FormatTime, TimeStamp, , M/d/y hh:mmtt
Send %TimeStamp% -
Notice at the end of the Send line, there is a space, dash and a trailing space. However, when this executed, no trailing space is sent. I even tried adding two spaces to the end of that line, but when sent it still ends at the dash.
What am I missing here?
Send Trailing Space? Topic is solved
Re: Send Trailing Space? Topic is solved
It gets trimmed automatically. But there are ways to prevent this:
Either
or
I prefer the expression approach ... another way with expressions:
Edit: Another one, closer to your original line:
Either
Code: Select all
Send %TimeStamp%%A_space%-%A_space%
Code: Select all
Send % TimeStamp A_space "-" A_space
Code: Select all
Send % TimeStamp " - "
Code: Select all
Send %TimeStamp% -{Space}
https://www.autohotkey.com/docs/commands/Send.htm#Parameters wrote:{Space}
Space (this is only needed for spaces that appear either at the beginning or the end of the string to be sent -- ones in the middle can be literal spaces)
Re: Send Trailing Space?
Excellent! Thank yo so much.
I wasn't aware of any of those options, and the expression approach is very cool.
I wasn't aware of any of those options, and the expression approach is very cool.
Who is online
Users browsing this forum: boiler, Google [Bot], jmone, keylo, mikeyww, teadrinker and 44 guests