Main Area and Open Discussion > General Software Discussion
Problem with AHK time stamping
Attronarch:
I am using AHK script for text expansion and I've run into some problems with time stamps. Up to now I've been using only one time stamp (date, first one in the code), but after I added two more I messed up everything.
Code excerpt:
--- ---:*::date::
FormatTime, CurrentDate,, yyyy-MM-dd ; This is one type of the date format
SendInput, %CurrentDate%
:*::st::
FormatTime, CurrentStartTime,, yyyy-MM-dd hh:mm:ss ; This is one type of the date format
SendInput, %CurrentStartTime% START
:*::ft::
FormatTime, CurrentFinishTime,, yyyy-MM-dd hh:mm:ss ; This is one type of the date format
SendInput, %CurrentFinishTime% FINISH
They generate:
--- ---2016-04-172016-04-17, 09:51:55 START2016-04-17, 09:51:55 FINISH
2016-04-17 09:51:59 START2016-04-17 09:51:59 FINISH
2016-04-17 09:52:01 FINISH
While I would like them to generate:
--- ---2016-04-17
2016-04-17 09:51:59 START
2016-04-17 09:52:01 FINISH
What did I do wrong?
MilesAhead:
I would try adding `n to the end of your Sendinputs. If that does not work try `r`n for spacing tabs may be useful... `t
skwire:
Those hotstrings work fine for me in a text editor. What type of app are you trying to use them within?
Attronarch:
I would try adding `n to the end of your Sendinputs. If that does not work try `r`n for spacing tabs may be useful... `t
-MilesAhead (April 17, 2016, 08:11 AM)
--- End quote ---
When I add `n, for :date I get:
--- ---2016-04-17
2016-04-17 06:14:10 START
2016-04-17 06:14:10 FINISH
for :ts I get:
--- ---2016-04-17 06:14:17 START
2016-04-17 06:14:17 FINISH
For :tf I get:
--- ---2016-04-17 06:14:20 FINISH
With `r`n it is the same but with added "enters".
What I would like to get is 2016-04-17 for :date, 2016-04-17 06:14:10 START for :ts, and 2016-04-17 06:14:10 FINISH for :tf.
Those hotstrings work fine for me in a text editor. What type of app are you trying to use them within?
-skwire (April 17, 2016, 11:07 AM)
--- End quote ---
They do work, but they do not produce results I wanted them to (see above).
skwire:
Ah, I see what you're getting at. Just add "Return" after each hotstring.
--- Code: Autohotkey ---:*::date::FormatTime, CurrentDate,, yyyy-MM-dd ; This is one type of the date formatSendInput, %CurrentDate%Return :*::st::FormatTime, CurrentStartTime,, yyyy-MM-dd hh:mm:ss ; This is one type of the date formatSendInput, %CurrentStartTime% STARTReturn :*::ft::FormatTime, CurrentFinishTime,, yyyy-MM-dd hh:mm:ss ; This is one type of the date formatSendInput, %CurrentFinishTime% FINISHReturn
Navigation
[0] Message Index
[#] Next page
Go to full version