| View previous topic :: View next topic |
| Author |
Message |
Guest
|
Posted: Sun Feb 20, 2005 5:37 pm Post subject: How can I add the actual date in a hotstring? |
|
|
Hello,
maybe a stupid question, but I can't solve the task to add the actual date in the output from a hotstring.
I tried things like
:R:dat::Mytown, den %FormatTime, OutputVar%
but it's not working...
Thanks for any help!
Carlos |
|
| Back to top |
|
 |
Serenity
Joined: 08 Nov 2004 Posts: 894
|
Posted: Sun Feb 20, 2005 6:47 pm Post subject: |
|
|
| Code: | FormatTime, TimeString, , hh:mm:ss - ddd, dd MMM
^T::
send, %TimeString%
return |
Replace ^T with your hotstring.  _________________ "Anything worth doing is worth doing slowly." - Mae West
 |
|
| Back to top |
|
 |
jonny
Joined: 13 Nov 2004 Posts: 3004 Location: Minnesota
|
Posted: Sun Feb 20, 2005 11:56 pm Post subject: |
|
|
| The percentage markers designate a variable, and cannot be used like functions. AHK is command-based, and is more like BASIC than C. |
|
| Back to top |
|
 |
Guest
|
Posted: Mon Feb 21, 2005 5:40 pm Post subject: |
|
|
Hello Friends,
I am sorry, but this is not working.
I use the script "hotkey helper.ahk" which is included in the AHK help. There ist the line
:R:dat::Berlin, den send, %TimeString%
This should output the following by typing the characters "dat":
Berlin, den 21.2.2005
(My town and the current date)
Actually by typing "ahk" the script is always printing
Berlin, den send, %TimeString%
I need the exact expression to make this hotkey working in the "hotkey helper.ahk" script.
Thanks for your help
Carlos |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Mon Feb 21, 2005 6:23 pm Post subject: |
|
|
| Quote: |
TimeString = %A_DD%.%A_MM%.%A_YYYY%
::dat::Berlin, den %TimeString%
Return | Gib "dat" ein gefolgt von einem beliebigen Zeichen ...
CU @ www.autohotkey.de |
|
| Back to top |
|
 |
Guest
|
Posted: Mon Feb 21, 2005 9:59 pm Post subject: |
|
|
Hello all,
I am really sorry, but all solutions are not working properly.
To remember: I use the script "hotkey helper.ahk" which contains the following auto-hotkeys at the end of the script:
>snip>
:R:vde::vielen Dank für Ihre eMail vom
:R:vdf::vielen Dank für Ihr Telefax vom
:R:vdn::vielen Dank für Ihre Nachricht vom
TimeString = %A_DD%.%A_MM%.%A_YYYY%
:R:dat::Berlin, den %TimeString%
Return
:R:div::- Diverses
>snap>
The auto-hotkey "dat" is not working properly, because the result if I type "dat" is
Berlin, den %TimeString%
Uhm, seems to be very difficiult...
Greetings,
Carlos |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Tue Feb 22, 2005 1:48 am Post subject: |
|
|
To send a variable such as times and dates, you must use a multi-line hotstring. Multi-line hotstrings must not have their first line on the same line with the hotstring abbreviation. Working example:
::dat::
Send %A_DD%.%A_MM%.%A_YYYY%
SendRaw %A_EndChar% ; Optional.
return |
|
| Back to top |
|
 |
Guest
|
Posted: Tue Feb 22, 2005 12:16 pm Post subject: |
|
|
Hello Chris, this is working fine, thank you.
Now I get by typing "dat"
22.02.2005
But I need the text "Berlin, den " before the date. How can I add this text automatically before the date?
Thanks for your help
Carlos |
|
| Back to top |
|
 |
savage
Joined: 02 Jul 2004 Posts: 206
|
Posted: Tue Feb 22, 2005 4:17 pm Post subject: |
|
|
Just add it to the front of the send statement, like so:
::dat::
Send Berlin, den %A_DD%.%A_MM%.%A_YYYY%
SendRaw %A_EndChar% ; Optional.
return |
|
| Back to top |
|
 |
Guest
|
Posted: Wed Feb 23, 2005 10:18 am Post subject: |
|
|
Hello Savage,
great- this is now working exactly like I want.
Thanks a lot for your effort.
Carlos |
|
| Back to top |
|
 |
|