OT: AutoIt script help for sending date/time to screen?

  • Thread starter Thread starter fitwell
  • Start date Start date
F

fitwell

I need to be able to insert the date/time in this format using an AI
script:

"Tue., Jun.29.2004; 07h56
(enter)
(enter)"

(The time is shown in a format for 24 hours.)

I'm okay now with the "send" syntax and things like the {enter}
keystroke. It's the date/time that I can't seem to figure out. I'm
on the page in the help file with the title "Macro Reference - Time
And Date" but haven't seen any examples of using this syntax, or even
if it's the right thing to use. (i.e., @YEAR code, etc.)

Can anyone point me in the right direction?

Thanks.
 
I need to be able to insert the date/time in this format
using an AI script:

"Tue., Jun.29.2004; 07h56
(enter)
(enter)"

(The time is shown in a format for 24 hours.)

I'm okay now with the "send" syntax and things like the
{enter} keystroke. It's the date/time that I can't seem to
figure out. I'm on the page in the help file with the
title "Macro Reference - Time And Date" but haven't seen
any examples of using this syntax, or even if it's the
right thing to use. (i.e., @YEAR code, etc.)

Yes :)

see if this would work, it will insert the data into a file
called filedate.txt:

;=====script start============
; format for week day
Select
Case @WDAY =1
$weekday = "Sun."
Case @WDAY =2
$weekday = "Mon."
Case @WDAY =3
$weekday = "Tue."
Case @WDAY =4
$weekday = "Wed."
Case @WDAY =5
$weekday = "Thur."
Case @WDAY =6
$weekday = "Fri."
Case @WDAY =7
$weekday = "Sat."
EndSelect

; format for months
Select
Case @mon =1
$monthday = " Jan."
Case @mon =2
$monthday = " Feb."
Case @mon =3
$monthday = " Mar."
Case @mon =4
$monthday = " Apr."
Case @mon =5
$monthday = " May."
Case @mon =6
$monthday = " Jun."
Case @mon =7
$monthday = " Jul."
Case @mon =8
$monthday = " Aug."
Case @mon =9
$monthday = " Sept "
Case @mon =10
$monthday = " Oct "
Case @mon =11
$monthday = " Nov "
Case @mon =12
$monthday = " Dec. "
EndSelect

$myformat = $weekday & ", " & $monthday & @MDAY & "." & @YEAR &
"; " & @HOUR & "h" & @MIN

$filewithdate = "filedate.txt"
If FileExists ($filewithdate) =0 then
FileOpen ($filewithdate, 1)
FileWriteLine ($filewithdate, $myformat)
FileClose($filewithdate)
Else
FileWriteLine ($filewithdate, $myformat)

EndIf



--
RL
*******************************************
Unofficial Adaware Updater:
http://home.earthlink.net/
~ringomei/Unofficial_adaware_updater.html

Little (File) Backer Upper:
http://home.earthlink.net/
~ringomei/Backup_tool_Backer_Upper.html

Uptime Quickie; Lefty Animated Cursors;
http://home.earthlink.net/~ringomei/page2.html
*******************************************
 
Yes :)

see if this would work, it will insert the data into a file
called filedate.txt:

Hi, RL! I'm progressing quite rapidly in certain AI scripts! I'm
very pleased with it.

This script didn't work, btw. It looks like a nifty one and I just
copy and paste into a text file then gave it an au3 extension but when
run, it gives me an error on line 48. The error references the AU3
script and then goes on to say:

"Line 48

$myformat = $weekday & "," & $monthday & @MDAY & "." @YEAR &
$myformat = ^ERROR

Error:Error in expression"

Also, I don't know if this will help explain things, but I mainly
would use AI as what in PowerPro is called a *SendKeys operation. In
AI, most of my scripts use the "Send" syntax like this one here below
- without the "start of script" and "end of script" lines:

-------(start of script)-------(adds comment coding to an html file)
Send("<br>{enter}<br>{enter}<{!}-- ?? --><br><font
color={#}><b>{enter}{enter}</b></font><br>{up}{left}{left}{left}{left}{left}")
-------(end of script)-------

Also, I'm not sure what the function of the "filedate.txt" is, but
this text would need to go directly to an open program on the screen
so hopefully I can avoid sending to an actual file as this script
seems to want to do. Also, it would need to handle sending text
anywhere rather than using a window with a title. <g>

Thanks for this effort, I appreciate it.

I'm going to keep trying. This date/time thing is eluding me, but I'd
like to be able to do this as my journal program is not able to insert
the current date and time. I did this manually the first year or so
of using my journal program and it can be quite tiring. PowerPro does
the job perfectly, but as I've mentioned before, after my computer has
been on for many hours, launching PP crashes my system. Not good <g>.

Thanks once again!
 
Yes :)

see if this would work, it will insert the data into a file
called filedate.txt:

;=====script start============
; format for week day
Select
Case @WDAY =1
$weekday = "Sun."
Case @WDAY =2
$weekday = "Mon."
Case @WDAY =3
$weekday = "Tue."
Case @WDAY =4
$weekday = "Wed."
Case @WDAY =5
$weekday = "Thur."
Case @WDAY =6
$weekday = "Fri."
Case @WDAY =7
$weekday = "Sat."
EndSelect

; format for months
Select
Case @MON =1
$monthday = " Jan."
Case @MON =2
$monthday = " Feb."
Case @MON =3
$monthday = " Mar."
Case @MON =4
$monthday = " Apr."
Case @MON =5
$monthday = " May."
Case @MON =6
$monthday = " Jun."
Case @MON =7
$monthday = " Jul."
Case @MON =8
$monthday = " Aug."
Case @MON =9
$monthday = " Sept "
Case @MON =10
$monthday = " Oct "
Case @MON =11
$monthday = " Nov "
Case @MON =12
$monthday = " Dec. "
EndSelect

$myformat = $weekday & ", " & $monthday & @MDAY & "." & @YEAR &
"; " & @HOUR & "h" & @MIN

$filewithdate = "filedate.txt"
If FileExists ($filewithdate) =0 then
FileOpen ($filewithdate, 1)
FileWriteLine ($filewithdate, $myformat)
FileClose($filewithdate)
Else
FileWriteLine ($filewithdate, $myformat)

EndIf

R.L., good afternoon!

I ended up installing the beta 102 and have a script that now works!
Yeay!

Thought I'd pass it along. Here is the code (I named this one
"CurrentDateAndTime- new.au3"):



#include <date.au3>
$thismonth = _DateMonthOfYear( @MON, 1 )
$thisday = _DateDayOfWeek( @WDAY, 1 )
Send($thisday & '., ' & $thismonth & '.' & @MDAY & '.' & @YEAR & '; '
& @HOUR & 'h' & @MIN)
Send("{enter}{enter}")



Isnt' that glorious? This has allowed me to start using my journal
program again frequently! I was too lazy to keep typing all that in
by hand.

And since I go back to earlier dates to update certain things but also
like the date/time I'm writing that in to appear, I made up a similar
script. It looks like this (I called this one
"CurrentDateAndTime-append.au3":




#include <date.au3>
$thismonth = _DateMonthOfYear( @MON, 1 )
$thisday = _DateDayOfWeek( @WDAY, 1 )
Send("{enter}")
Send("*********************************************{enter}")
Send($thisday & '., ' & $thismonth & '.' & @MDAY & '.' & @YEAR & '; '
& @HOUR & 'h' & @MIN)
Send("{enter}{enter}")



This is the third type of script that PowerPro was so invaluable for
me before.

I use one type for starting logging-in processes on a forum. I leave
the passwords out but they still save me repetitive keystrokes as I
clean out my temp files constantly with clean-it bats so I always have
to re-type these things.

The other script codes are ones for html hardcoding.

And the last were the codes for The Diary, my journal program, as it's
lacking this very vital function in its programming that of putting in
date/time of the entry.

Cheers!
 
R.L., good afternoon!

I ended up installing the beta 102 and have a script that
now works! Yeay!

Thought I'd pass it along. Here is the code (I named this
one "CurrentDateAndTime- new.au3"):

congratulate!!!! :-)

--
RL
*******************************************
Unofficial Adaware Updater:
http://home.earthlink.net/
~ringomei/Unofficial_adaware_updater.html

Little (File) Backer Upper:
http://home.earthlink.net/
~ringomei/Backup_tool_Backer_Upper.html

Uptime Quickie; Lefty Animated Cursors;
http://home.earthlink.net/~ringomei/page2.html
*******************************************
 
Back
Top