#21676 - 2002-05-13 09:12 PM
automation of notes
|
bluesteel
Fresh Scripter
Registered: 2002-05-13
Posts: 32
Loc: Montreal, Quebec Canada
|
hi all, im new to kixtart, and ive been doing some basic scripting.....i made a script that would automate the setup of lotus notes(after installation, the preferences and server setup)..... the script works most of the time, however when something happens out of the scripts parameters it screws up........my script involves using sendkeys to send the cursor through the motions of the setup, but when a window pops up, like new mail or somethng similar, the script cannot handle it. how can i make it so my script is more flexible?
|
|
Top
|
|
|
|
#21680 - 2002-05-14 07:09 PM
Re: automation of notes
|
Chris S.
MM club member
   
Registered: 2002-03-18
Posts: 2368
Loc: Earth
|
We can use AutoIt within a KiX script as well. In fact, the two complement each other nicely. KiX can do many things that AutoIt cannot. AutoIt handles "windows" better. Here's a sample of using the AutoItX.dll:
code:
; Check for and install AutoItX.dll if not present. if exist("%windir%\autoitx.dll")=0 copy "@scriptdir\autoitx.dll" "%windir%" shell "regsvr32 /s %windir%\autoitx.dll" endif $oAutoIt = CreateObject("AutoItX.Control") if $oAutoIt=0 ? "AutoItX not registered." endif ; Pause script until "Version Conflict" window exists. ; Then send an ALT-Y to confirm "Keep existing driver." $=$oAutoIt.WinWaitActive ("Version Conflict","",0) $=sendkeys("~Y")
As mentioned, this script would have to be running concurrently with the execution of another script. This "Adlib" example would just be sitting there waiting until the proper condition existed. Probably not the best example in the world, as it would stay paused until that window popped up. It would be better to do a "IfWinExist." You could then have the "Adlib" loop as long as Outlook (or Notes in this case) is open. Then, once Outlook is closed, the "Adlib" script exits.
|
|
Top
|
|
|
|
#21681 - 2002-05-14 08:51 PM
Re: automation of notes
|
bluesteel
Fresh Scripter
Registered: 2002-05-13
Posts: 32
Loc: Montreal, Quebec Canada
|
Thats a great idea, thx. I was thinking along the lines of a setfocus(), but i figured it wouldnt work because it may not always be the same window that activates.........but i'll give that a try.
thx
|
|
Top
|
|
|
|
#21682 - 2002-05-14 10:04 PM
Re: automation of notes
|
Chris S.
MM club member
   
Registered: 2002-03-18
Posts: 2368
Loc: Earth
|
If you have different possible windows that could pop up you could have your "Adlib" loop constantly checking the "title" of the active window with this AutoItX command:
code:
$variable=$oAutoIt.WinGetActiveTitle()
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1821 anonymous users online.
|
|
|