Sign in to follow this  
Followers 0
Diana (Cda)

Sending date/time to a text-like interface?

11 posts in this topic

I need to send this text to a notepad-like interface:

---------------(start of script)---------------

Tue., Jun.29.2004; 07h56

(enter)

(enter)

---------------(end of script)---------------

I know how to do the {enter} code part:

Send("{enter}{enter}{enter}")

but how to send the date in time in the above format, which is:

ddd.mm.dd.yyyy; HHhmm?

Thank you! :D

Share this post


Link to post
Share on other sites



:D Darn, my message wasn't clear. I need to send the current date and time, not a specifc date and time (that would be easy <g>).

Thanks!

Share this post


Link to post
Share on other sites

Try this

In the helpfile: Macro Reference - Time And Date

arctor

Share this post


Link to post
Share on other sites

You can use the macro

@WDAY

@MON

@MDAY

@YEAR

@HOUR

@MIN

$weekday = @WDAY;returns the week day as a number
$month = @MON
if $weekday = 1 then
$result = "Sun., "
elseif $weekday = 2 then
$result = "Mon., "
elseif $weekday = 3 then
$result = "Tue., "
elseif $weekday = 4 then
$result = "Wed., "
elseif $weekday = 5 then
$result = "Thu., "
elseif $weekday = 6 then
$result = "Fri., "
elseif $weekday = 7 then
$result = "Sat., "
endif
if $month = 01 then
$result = $result & "Jan."
elseif $month = 06 then
$result = $result & "Jun."
endif
msgbox(0,"result", $result)
Send($result)

From there you should be able to finish the script.

Bit lengthy but it will work.

Cheers


CheersNobby

Share this post


Link to post
Share on other sites

Thanks, guys. The scripts worked up to the point you all left them at.

I'm going to have to give this one up for now. I've been working on this for 3 days and still not any closer. I just don't understand what to do next. Ah, well, I won't let this get me down.

(p.s., arctor, thanks bunches. If I'd understood the help file, I wouldn't have registered and come to this forum. <sigh>)

Thanks everyone.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

I am quite new to coding and the only things I have ever used are dos, bat and Autoit (although I want to learn more). Anyhow, there are some usage in Autoit I saw being used but can't quite get what it does. Why it is always "While 1"? when using gui? What does the "1" represent? I don't think I found any explanation in the help file (all I saw was the While...Wend function and whenever "While 1" appear in other examples, it almost comes out of nowhere - I mean that little "1" part, not the "While" part :D ).

Another one I saw you use is this "[", again what does it do? I don't remember seeing it in the help file either. Perhaps someone could explain to me in "easy-language"?? :wacko:

TIA

Edited by R.L.

Share this post


Link to post
Share on other sites

Hallelujah, a kind poster elsewhere provided me with this coding which looks more the thing!:

send(@MON & '.' & @MDAY & '.' & @YEAR & '; ' & @HOUR & 'h' & @MIN)

Send("{enter}{enter}")

I'm going to run it right now so the input can be seen:

"06.30.2004; 03h19

"

This is great and a huge step in this direction. The output I need, though, is this:

"2004.06.30.Wed; 03h19

"

How can the above code be modified to give me that, pls?

Thanks so much! This is such an important script for me. The other PowerPro replacements I've been able to code myself but this one, once done will be the clincher. Once I have this, then I can use AI scripts in lieu of PowerPro's *SendKeys scripts.

Thank you!

Share this post


Link to post
Share on other sites

DONE!

Here it is finally! Also, it meant downloading the GUI beta version, #102, as I had 101. Here is the working script tweaked to actual date style that ultimately worked best in my journal program:

#include <date.au3>

$thismonth = _DateMonthOfYear( @MON, 1 )

$thisday = _DateDayOfWeek( @WDAY, 1 )

Send($thisday & '., ' & $thismonth & '.' & @MDAY & '.' & @YEAR & '; ' & @HOUR & 'h' & @MIN)

Send("{enter}{enter}")

So simple.

Thanks everyone! I learned a lot.

Share this post


Link to post
Share on other sites

I am quite new to coding and the only things I have ever used are dos, bat and Autoit (although I want to learn more).  Anyhow, there are some usage in Autoit I saw being used but can't quite get what it does.  Why it is always "While 1"? when using gui?  What does the "1" represent?  I don't think I found any explanation in the help file (all I saw was the While...Wend function and whenever "While 1" appear in other examples, it almost comes out of nowhere - I mean that little "1" part, not the "While" part  :D ).

You can also write:

While 1 = 1

Or something similar if it makes it easier to understand.

Share this post


Link to post
Share on other sites

Larry, I saw your post buddy, hehe. Although I haven't needed to do what Cda is wanting to, I did learn from your post how StringSplit works, and have copied your script to my vast armada of little scripts that when I do need them, they will come in handy, how how about a nice bot script for Quake 3? muhahahahah.... :D

Share this post


Link to post
Share on other sites

You can also write:

While 1 = 1

Or something similar if it makes it easier to understand.

Haha :D now I get it! So it could easily be 2=2; 3=3....

Thanks!

One more thing perhaps, could someone give me a robust and easy example as to how to set and use my own arrays?? I saw Larry's example, but just want one more. Thanks

:iamstupid:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0