I think that you are interested more in the functions of the AutoIT, then in the actual AutoIT programming language.
Because the Pascal Script is very powerful here is the solution:
AutoIT is available as an ActiveX Control named AutoItX
www.hiddensoft.com/autoit3/files/unstable/autoitx/AutoItX3.dll.
Download the file above then open APB and in a new project add that file to the embedded files.
Then simply use this script:
var AutoITObject : variant;
procedure UseAutoItObject;
begin
//Use the AutoIT Object:
try
if MsgBox('This script will run the calculator and type in 2 x 4 x 8 x 16 and then quit. Run?','AutoIt Example (English Only) - ActiveX',mb_iconquestion or mb_yesno) = idno then
begin
MsgBox('OK. Bye!','AutoIt',0);
application.Terminate;
exit;
end;
AutoITObject.Run('calc.exe');
AutoITObject.WinWaitActive('Calculator');
AutoITObject.AutoItSetOption('SendKeyDelay', 400);
AutoITObject.Send('2*4*8*16=');
AutoITObject.Sleep(2000);
AutoITObject.WinClose('Calculator');
AutoITObject.WinWaitClose('Calculator');
except
end;
end;
procedure Form1OnCreate(Sender: TObject);
begin
try
//register ActiveX file so it can be used from script
RegisterServer(Repconst('%EMBEDDED%\AutoItX3.dll'),false);
AutoITObject := CreateOleObject('AutoItX3.Control');
except
MsgBox('Cannot initialize the AutoIT ActiveX Control.%n%nReason:%n'+ExceptionParam,'Error',mb_iconstop);
application.Terminate;
end;
UseAutoItObject;
end;
procedure Form1OnDestroy(Sender: TObject);
begin
try
//unregister the file and free unused libraries to be able to delete it from temp dir
AutoITObject := Unassigned;
unRegisterServer(Repconst('%EMBEDDED%\AutoItX3.dll'),false);
CoFreeUnusedLibraries;
except
end;
end;
Please let me know if this helps you.