Buy Now & Pricing Download iMacros Search:
Home Products Purchase Service & Support Partner Programs Contact Us
 iMacros
  Product Information
Success Stories NEW
Compare Editions
Web Image Recognition
Press Reviews NEW
System Requirements
Online User Manual
Product Flyer (PDF)
  Support
Online Demos
Code Samples
Tutorials
iMacros User Forum
  FAQ
  Buy iMacros
  Customer Login
  Support Ticket
   
 
   
   

You are here: iOpus > iMacros > Support > IM Tutorial: Perl Scripting 

Tutorial: Perl Scripting 

Prerequisites:  iMacros Scripting Edition  

Goal: Use the iMacros Scripting Interface with Perl instead of the Windows Scripting Host.

This tutorial was provided by Mark Swank of Nokia Internet Communications.

The iMacros Scripting Interface can use used from any programming or script language that can use ActiveX interfaces. The following example shows you how to call this interface from Perl. The script initializes the Scripting Interface and calls a macro with name "Yahoo". It also contains a subroutine that prints out messages returned by the iMacros Scripting Interface.

 

Begin new script
#------------------------------------------------------------------------

use Win32::OLE;

$b = Win32::OLE->new('imacros') or die "Iopus could not be started by Win32:OLE\n";
$b->{Visible} = 1;
$b->iimInit();

#Calling an IOPUS macro ie;yahoo.iim . Write a Simple iim script to goto www.yahoo.com
my $macro = "yahoo";

$b->iimPlay($macro);
&err ();
$b->iimExit();

########################################################################
# Get the last message reported from Iopus upon macro completion status#
########################################################################
sub err {
   $lastMessage = $b->iimGetLastMessage();
       if ($lastMessage =~ /Macro completed/) {
           print("Success <$macro> $lastMessage\n");
           #write a logger here for Success $lastMessage
       }
        else{
             print("Failure <$macro> $lastMessage\n");
             #write a logger here for Failure $lastMessage
            }
}

#___________________________________________________________________________
_
End New Script

 

 
 
©2000-2009 iOpus Inc., Pat. Pending
| Search Website | Purchase iMacros | Community Forums | Subscribe to iOpus News
 

Site performance and uptime monitored by AlertFox Website Monitoring -> View our current performance.
AlertFox's unique web transaction monitoring is powered by iMacros Web Test Automation.