Menu

Example Scripts

2007-08-16
2013-04-26
  • Ray Benjamin

    Ray Benjamin - 2007-08-16

    Can someone tell me where I can find some good example scripts?

    Thanks,
      Ray

     
    • Ray Benjamin

      Ray Benjamin - 2007-08-16

      Doh,

      Found the scripts, they are in the docs directory if you download the GroovyForOpenOfficeSource file. Some documentation is still needed, and more example scripts, but there's enough there to get you started. If worse comes to worse, you can go to the source code of the extension.

      Ray

       
    • Jim White

      Jim White - 2007-08-16

      There are some samples in Groovy_Samples.odt available in the Files area along with the GroovyScripting.oxt extension.  They aren't very informative, but will get you started.

      The best OOo Groovy macro example I have is what I call Wings (http://www.ifcx.org/wiki/Wings.html).  It isn't quite ready for prime time (although it works fine), but you're welcome to check it out.  The place to get it at the moment is directly from SVN:

      http://ifcx.svn.sourceforge.net/viewvc/ifcx/Wings/trunk/OpenOffice/Wings.odt?view=log

      Be careful when downloading.  You must do a "right-click/save as..." on the "download" link sort of thing, and be sure that it doesn't get unzipped (ODF files are actually zip files).  Some browsers will also add an extra suffix (like .txt or .zip) after the .odt, which you'll want to remove.

      You can also see the macro source here:

      http://ifcx.svn.sourceforge.net/viewvc/ifcx/Wings/trunk/OpenOffice/GroovyEval.groovy?view=markup

      That shows that Groovy macros can be as terse as OOo BASIC macros thanks to the "use (UnoCategory)" trick and the relentless omission of extra qualification.  You'll want to read the Wings.odt document though to see what it is for.

      Jim

       

Log in to post a comment.