a quick example demonstrating how to get data from the system using AppleScript within Java:

import javax.script.*;

class Test {
  public static void main(String[] args) throws Throwable {
    // before running, select a contact with an image in Address Book.app
    String script = "tell application \"Address Book\"\n"
                  + "   set contacts to selection\n"
                  + "   set contact to item 1 of contacts\n"
                  + "   set photothing to image of contact\n"
                  + "end tell";

    ScriptEngineManager mgr = new ScriptEngineManager();
    ScriptEngine engine = mgr.getEngineByName("AppleScript");
    Object retval = engine.eval(script);

    // prints: java.awt.image.BufferedImage
    System.out.println(retval.getClass().getName());
  }
}

while the shipping product was largely written by Mike Swingler, this was my intern project in 2007.