Wednesday, August 3, 2011

iMacros Tutorials Part 1 [Delphi]

Create Project

  • Create new project as "VCL Forms Application"
    1createProject.png

  • Add button that will initiate the iMacros actions
    2addButton.png

Add code to button

  • Double click button to edit its code
  • Adjust the code to read liek this:
procedure TForm1.Button1Click(Sender: TObject);
begin
 with CreateComObject(CLASS_App) as IApp do begin
  iimInit(,True,30);
  iimplay('CODE:URL GOTO=http://www.iopus.com',30);
 end;
end;
end.

Add iMacros Scripting Interface

  • Menu -> Component -> Import Components
    3addcomponent.png

  • Import Type Library
    4importTypeLibrary.png

  • Select "iMacros Scripting Interface"
    5iMacrosScriptingInterface.png

  • Skip next window
    6noChanceNecessary.png

  • Add Scripting Interface as unit to project
    7addUnitToProject.png

  • Double click TForm1 to add references to the Scripting Interface:
    8editForm.png

  • Add Scirpting Interface (and COM object handling) to "uses" clause:
    9changeUsesClause.png

Done

  • That's it. Once being started, the software will present the form, and when the button is clicked, it starts an iMacros browser window, that visits www.iopus.com:
    10start.png

No comments:

Post a Comment