#87047 - 2002-07-26 09:03 AM
AutoItX COM
|
punkie
Getting the hang of it
Registered: 2002-06-23
Posts: 67
|
I need some advice on how to use the AutoItX, the following code seems to confuse Kix...
code:
select case @WDayNo = "1" $day = "Sun" case @WDayNo = "2" $day = "Mon" case @WDayNo = "3" $day = "Tue" case @WDayNo = "4" $day = "Wed" case @WDayNo = "5" $day = "Thu" case @WDayNo = "6" $day = "Fri" case @WDayNo = "7" $day = "Sat" endselect
$objAutoIt = CreateObject("AutoItX.Control") $getwindow = $objAutoIt.WinWaitActivate("Untitled - Notepad","",5) $sendkeys = $objAutoIt.Send("$day @MDayNo @Time -- hello world{ENTER}") sleep 5
It results in the error: Script error: expected expression! $getwindow = $objAutoIt.WinWaitActivate("Untitled - Notepad","",5)
But the following code seem to work, unfortunately I can't control the program like I want using this because I want to get the windows text. Also I wouldn't want to use it directly through an AutoIt script, I prefer using dlls.
code:
$objWScript = CreateObject("WScript.Shell") $objAutoIt = CreateObject("AutoItX.Control") $getwindow = $objWScript.AppActivate("Untitled - Notepad") $sendkeys = $objAutoIt.Send("$day @MDayNo @Time -- hello world{ENTER}") sleep 5
|
|
Top
|
|
|
|
#87049 - 2002-07-26 01:54 PM
Re: AutoItX COM
|
punkie
Getting the hang of it
Registered: 2002-06-23
Posts: 67
|
I still get same error for some reason. Any other ideas?
|
|
Top
|
|
|
|
#87051 - 2002-07-26 02:39 PM
Re: AutoItX COM
|
Chris S.
MM club member
   
Registered: 2002-03-18
Posts: 2368
Loc: Earth
|
My first post was from home, so I didn't try out your code. I found the problem...
code:
;$getwindow = $objAutoIt.WinWaitActivate ("Untitled - Notepad","",5) $getwindow = $objAutoIt.WinWaitActive ("Untitled - Notepad","",5)
[ 26 July 2002, 14:39: Message edited by: Chris S. ]
|
|
Top
|
|
|
|
#87052 - 2002-07-26 03:04 PM
Re: AutoItX COM
|
punkie
Getting the hang of it
Registered: 2002-06-23
Posts: 67
|
Thanks for your help Chris, it works now I knew it was something simple...
|
|
Top
|
|
|
|
#87053 - 2002-07-26 03:12 PM
Re: AutoItX COM
|
Chris S.
MM club member
   
Registered: 2002-03-18
Posts: 2368
Loc: Earth
|
Personally, I think its annoying how programming/scripting languages insist on you spelling the commands correctly.
|
|
Top
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
0 registered
and 2220 anonymous users online.
|
|
|