Inputing Current Date in Script
Moderators: JRL, Dorian (MJT support)
Inputing Current Date in Script
I am trying to write a script that will run a specific report. The problem I have is that this report requires date parameters, I can't seem to find any command that will return the current date in the format mm/dd/yyyy to the field that the cursor is sitting in at that particular point in the script. Does anyone know if this is possible? I could use some help - Thanks
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Code: Select all
Month>mm
Day>dd
Year>yyyy
Let>date=%mm%/%dd%/%yyyy%
SetFocus>WindowName* where the field is located.
Tab to the field for data entry
Send>%date%
Be sure to remove any trailing spaces.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
getting closer
I am getting much closer except I actually realize now that the format of the date is actually mm/dd/yy instead of yyyy. Could you possibly help me out again? I tried just dropping the 2 y's off from the code you send but it must be more complex then just that, it had no effect on the outcome of the script. -thanks
Month>mm
Day>dd
Year>yyyy
MidStr>yyyy,3,2,yy
Let>date=%mm%/%dd%/%yyyy%
Day>dd
Year>yyyy
MidStr>yyyy,3,2,yy
Let>date=%mm%/%dd%/%yyyy%
MJT Net Support
[email protected]
[email protected]
Still having issues
It still seems to produce the same result. When the script outputs the date to the screen I have it waiting 10 seconds after so I can see the out put. It is coming across as 02/01/20 05:00:00 I do not want to populate the time field I want it to stay at the default of 00:00:00
I made a mistake. Should be:
Month>mm
Day>dd
Year>yyyy
MidStr>yyyy,3,2,yy
Let>date=%mm%/%dd%/%yy%
No idea why you're getting a time - the script above does nothing with a time, just the date.
Month>mm
Day>dd
Year>yyyy
MidStr>yyyy,3,2,yy
Let>date=%mm%/%dd%/%yy%
No idea why you're getting a time - the script above does nothing with a time, just the date.
MJT Net Support
[email protected]
[email protected]