
Using Jau

From the website:

  Dr. Andrew Davison
  Dept. of Computer Engineering
  Prince of Songkla University
  Hat yai, Songkhla 90112, Thailand
  E-mail: ad@fivedots.coe.psu.ac.th
  http://fivedots.coe.psu.ac.th/~ad/


If you use this code, please mention my name, and include a link
to the website.

Thanks,
  Andrew

============================

This directory contains many Java files, most of which are "Test" and
"Use" examples for Jau.

Jau is implemented in two files:
  * Jau.java, AutoItX3.java


The "Test" files:
  * TestApps.java: application discovery (see section 6.1 of the manual)
  * TestDesktop.java: multiple windows and mouse manipulation (sections 6.4 and 6.10)
  * TestPIDs.java: process related methods (section 6.3)
  * TestRun.java: the many ways to start/run an application (section 6.2)
  * TestWin.java:  manipulating the application window (section 6.5)


The "Use" files:
  * UseCalc.java, UseCalc2.java: the Microsoft (MS) calculator and its controls;
  * UseClip.java: the clipboard;
  * UseComMgmt.java: the "Computer Management" MMC snap-in, 
                     using tree and list view controls;
  * UseFirefox.java: utilize Firefox to access the Web;
  * UseNotepad.java, UseNotepad2.java, UseNotepad3.java: simple Jau with Notepad;
  * UsePP.java: creating and saving a slide in MS PowerPoint;
  * UsePaint.java: creating and saving a slide in MS PowerPoint;
  * UseSketchup.java: starting SketchUp, and communicating with its Ruby console;
  * UseToolTip.java: tooltips using low-level methods from AutoItX3;
  * UseWMP.java: playing (or restarting) a music clip with Windows Media Player;
  * UseWord.java: opening an existing DOCX file in MS Word, and saving it in PDF format;
  * UseXnView.java: image conversion with XnView


Assorted other files, used by the test code:
  * jauTest.pptx: used in TestRun.java
  * library.jpg:  used by UseXnView.java
  * musicClip.mp3: used by UseWMP.java
  * test.docx: used by UseWord.java


Two batch files:
  * compile.bat
  * run.bat
     - make sure they refer to the correct location 
       for your download of JNA


----------------------------
Before Compilation/Execution:

You need to download and install:

  * JNA: https://github.com/twall/jna
          I downloaded jna.jar and jna-platform.jar and stored them in
          d:\jna\

  * AutoIt:  http://www.autoitscript.com/site/autoit/downloads/
          I downloaded the current "AutoIt Full Installation" 
          (v3.3.10.2, 30th December, 2013) and
          let the installer place the package at its standard 
          location in Windows


----------------------------
Jau's Use of AutoIt

Jau assumes that AutoIt is installed at its standard location in Windows,
and that the AutoItX DLL is in the subdirectory AutoIt3\AutoItX\

Jau is clever enough to use either the 32-bit or 64-bit version of the DLL,
but assumes its name is AutoItX3.dll or AutoItX3_x64.dll

If you have changed any of this (or AutoIt has), then you'll need to 
modify the code in the Jau.getAutoItDLL() method in Jau.java. The method is 
located near the end of the file.

----------------------------
Compilation:

> compile Jau.java
    // you must have JNA installed;
    // this will compile the Jau and AutoItX3 classes

Then compile as many of the "Test" or "Use" files as you want to try.

> compile UseNotepad3.java

> compile UseCalc2.java

etc.

-----
Or just type:

> compile *.java

----------------------------
Execution:

> run UseNotepad3
    // you must have JNA and AutoIt installed

> run UseCalc2

Only "UseFirefox" takes a command-line argument -- a word whose definition
will be looked up online
e.g.
> run UseFirefox ontology

----------------------------
Last updated: 28th April 2014
