Jump to content

Send Date


Fuse
 Share

Recommended Posts

Hey there,

I'm very new to AutoIT, in fact this is my first script! I am trying to make a script to make our tape backup software more automated. This is what I have achieved so far and works well enough but I need a way of inserting the correct date:

=================================================

run("C:\program files\CA\BrightStor ARCserve Backup\BrightStorMgr.exe")

Sleep(3000)

MouseClick("left", 23, 280, 1)

Sleep(3000)

MouseClick("left", 252, 214, 1)

MouseClick("left", 477, 107, 1)

Send("DD/MM/YY")

ControlClick("Format", "", "[iD:1]")

Sleep(60000)

=================================================

How can I insert the date of the server so that the tape gets formated with the correct date?

Thanks

Link to comment
Share on other sites

$sDate = @MDAY & "/" & @Mon & "/" & StringRight(@Year, 2)
Send($sDate)

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Perfect!

Thanks for that

You are most welcome. Here is a better version to use if you always want day and month to have a leading 0 when less than 10. instead of 1/1/10, it will return 01/01/10

$Date = StringFormat("%02u/%02u/", @MDAY, @MON) & StringRight(@Year, 2)
Send($Date)

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Thanks for that GEOSoft I will use the updated one. I have one more question, is there a way to add the day infront of the date? For example, THURSDAY 12/03/09 (reason for this is thats how its always been on all our tapes, would be good to keep it the same) If that is not possible I'm not too bothered would just be nice. I have completed the script to start/shutdown application, format eject etc, very handy :P

Link to comment
Share on other sites

Thanks for that GEOSoft I will use the updated one. I have one more question, is there a way to add the day infront of the date? For example, THURSDAY 12/03/09 (reason for this is thats how its always been on all our tapes, would be good to keep it the same) If that is not possible I'm not too bothered would just be nice. I have completed the script to start/shutdown application, format eject etc, very handy :P

Sure. Just use the @WDay Macro with an array.

$aDay = StringSplit("Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday", "|")
$Date = StringFormat("%s %02u/%02u/", $aDay[@WDAY],@MDAY, @MON) & StringRight(@Year, 2)
Send($Date)

If you want more spaces between the weekday and the date just add them between the %s and the next % sign.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...