Inputing Current Date in Script

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Rhino30
Newbie
Posts: 5
Joined: Fri Jan 28, 2005 1:32 pm
Location: Grand Rapids, Michigan

Inputing Current Date in Script

Post by Rhino30 » Tue Feb 01, 2005 3:24 pm

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

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Tue Feb 01, 2005 4:39 pm

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!

Rhino30
Newbie
Posts: 5
Joined: Fri Jan 28, 2005 1:32 pm
Location: Grand Rapids, Michigan

getting closer

Post by Rhino30 » Tue Feb 01, 2005 5:02 pm

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

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Tue Feb 01, 2005 5:21 pm

Month>mm
Day>dd
Year>yyyy
MidStr>yyyy,3,2,yy
Let>date=%mm%/%dd%/%yyyy%
MJT Net Support
[email protected]

Rhino30
Newbie
Posts: 5
Joined: Fri Jan 28, 2005 1:32 pm
Location: Grand Rapids, Michigan

Still having issues

Post by Rhino30 » Tue Feb 01, 2005 5:33 pm

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

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Tue Feb 01, 2005 5:44 pm

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.
MJT Net Support
[email protected]

Rhino30
Newbie
Posts: 5
Joined: Fri Jan 28, 2005 1:32 pm
Location: Grand Rapids, Michigan

Awesome!

Post by Rhino30 » Tue Feb 01, 2005 5:55 pm

The time field follows the date field that I was populating so the 05 of 2005 was flowing over into that field. It is working wonderfully now though. Thanks so much for the help!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts