Jump to content
Sign in to follow this  
XeroFx

Date wrong on win7?

Recommended Posts

XeroFx

Hello, im making a script that will enable me to create a hotkey that will enter some text with a single key.

in the future i want to have a place to put your name, and a way to select a hotkey... but as of now i cant get it to work properly.

when i use it it works, but i get this as teh result

"1/11/09 Name - "

it is not showing that it is november.....

also after i use it, the shift key and alt key are locked... like they are still being pressed... do i have to use a keyup command?

it has been a few years since i have messed with autoit, and im kinda rusty... please help me!

im looking for the output to be: (along with the hotkeys not sticking)

"11/11/09 Name - "

;this is a test script

Global $sDate
Global $sName
Global $sYear

HotKeySet("+!d", "cdatadate") ;Shift-Alt-d

$sName = InputBox("Date Inserter", "Type your name.")
$sYear = StringRight(@YEAR, 2)
$sDate = String(@MON & "/" & @MDAY & "/" & $sYear)


Opt("SendKeyDelay", 7)          ;5 milliseconds
Opt("SendKeyDownDelay", 2)      ;1 millisecond

While 1
    Sleep(100)
WEnd


Func cdatadate()
    Send("" & $sDate & " " & $sName & " - ")
    HotKeySet("+!d")
    Send("+!d")
    HotKeySet("+!d", "cdatadate")
EndFunc

*** im on win7 x64, is this a possible problem with @MON?

Share this post


Link to post
Share on other sites
XeroFx

is there a solution?

ive read into the problem somewhat, and the date call still looks correct to me, any help is much appreciated.

thanks!

Share this post


Link to post
Share on other sites
LarryDalooza

Func cdatadate()
    Sleep(200)
    Send($sDate & " " & $sName & " - ",1)
    HotKeySet("+!d")
    Send("+!d")
    HotKeySet("+!d", "cdatadate")
EndFunc

try a sleep


f_mrcleansmalm_77ce002.jpgAutoIt has helped make me wealthy

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  

×