I am trying to <Send> a date that was stored as a variable from a GUI date selector.
The GUI line is as follows: <Gui, Add, DateTime, vSD, MM/dd/yyyy>
For the line <Send vSD>, the script sends the date in the YYYYMMDDHH24MISS format.
Is there a way to send the date in the MM/dd/yyyy format?
Thank you.
Sending Date from GUI in Certain Format
Re: Sending Date from GUI in Certain Format
Code: Select all
Gui, Font, s10
Gui, Add, DateTime, vSD, MM/dd/yyyy
Gui, Add, Button, x+m Default, OK
Gosub, F3
F3::
uid := WinActive("A")
Gui, Show,, Select a date
Return
ButtonOK:
Gui, Submit
FormatTime, date, %SD%, MM/dd/yyyy
WinActivate, ahk_id %uid%
Send {Text}%date%
Return
GuiEscape:
GuiClose:
Gui, Hide
Return
Re: Sending Date from GUI in Certain Format
Thank you! I was using the date format but did not figure to put the variable in between %%.mikeyww wrote: ↑25 Jul 2021, 13:48Code: Select all
Gui, Font, s10 Gui, Add, DateTime, vSD, MM/dd/yyyy Gui, Add, Button, x+m Default, OK Gosub, F3 F3:: uid := WinActive("A") Gui, Show,, Select a date Return ButtonOK: Gui, Submit FormatTime, date, %SD%, MM/dd/yyyy WinActivate, ahk_id %uid% Send {Text}%date% Return GuiEscape: GuiClose: Gui, Hide Return