Using iMacros with JAVA via JACOB (64bit support)

Share your tips, tricks and favorite iMacros macros, scripts and applications for web automation in general here.
Forum rules
iMacros EOL - Attention!

The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.

Thank you again for your business and support.

Sincerely,
The Progress Team
Post Reply
Hannes, Tech Support

Using iMacros with JAVA via JACOB (64bit support)

Post by Hannes, Tech Support » Mon Aug 23, 2010 8:37 am

Three notes before we start:

1) The process of how to set up a JAVA project in Eclipse, and how to add external resources (.jar or .dll files), can be found in this thread: http://forum.imacros.net/viewtopic.php?f=6&t=2703
2) We selected JACOB (http://sourceforge.net/projects/jacob-project/) because it is free software (cf. their site for the license), and because it supports 64bit systems
3) Documentation on using JACOB is pretty sparse, especially for beginners. Maybe you want to help that great project.

And here's how to call iMacros from Java using JACOB (having an IDE like Eclipse or NetBeans in mind):

1) Download JACOB (http://sourceforge.net/projects/jacob-project/files/). You won't need the source package for our task.
2) Create a new Java project
3) Add references to
3a) jacob.jar
3b) jacob.dll (whose real name is something like "jacob-1.15-M3-x64.dll"
4) Use the following code sample as a beginning

Code: Select all

import com.jacob.activeX.*;

public class iMacrosJACOBtest {

	public static void main(String[] args) {
		
		System.out.println("Started.");

		// connect to iMacros Scripting Interface
		ActiveXComponent iim = new ActiveXComponent("imacros");
		
		System.out.println("Calling iimInit");
		iim.invoke("iimInit"); // call iimInit()
		
		System.out.println("Calling iimPlay");
		iim.invoke("iimPlay", "CODE:URL GOTO=http://www.google.de"); // call iimPlay()
	}
}
Post Reply