Utility Scripts contributed by the OpenOffice.org community
This page contains downloads of utility scripts that have been contributed by the OpenOffice.org community. These scripts are intended to demonstrate how to write Java (or the dynamically-typed Beanshell) scripts for OpenOffice, with full access to both the OpenOffice.org API and the Java APIs. The scripts are for use with the Early Developer Release 0.3 of the Office Scripting Framework and all subsequent releases.Pre-requisites
- OpenOffice.org 1.1beta2 or above installed with the Scripting Framework Early Developer release 0.3. If you have not already done this then see the installation guide.
General Installation Procedure
- The scripts are made available for download as Zip files. To install the scripts, simply unzip them in either the <OfficeInstallation>/user or <OfficeInstallation>/share directories.
- The scripts are then available to be bound to the key or menu of
your choice using the Assign dialogs.
- If the scripts require any additional pre-requisites, installation steps or subsequent modification this will be documented below.
- If you wish to deploy these scripts into a document you will need
to create a new parcel recipe and copy the sources from the zip files
below. See the Developer
Guide for Netbeans for more information.
Available Scripts
- Word Count
- Capitalisation
- Post To Newsgroups
- Scripting Framework Issuezilla Query -> Writer
- Scripting Framework Issuezilla Query -> Calc
- Insert Copyright Symbol
- Insert Trademark Symbol
- Insert Hidden Text
- Export To HTML
- Combined Utilities
Word Count
Author: Duncan FosterAim: Provides a simple word count of the selected text.
Language: BeanShell
Pre-requisites: none
Download: WordCount.zip (2Kb)
Installation: no additional steps needed
Description: Uses the OpenOffice API to get the selected text, and then uses Java's StringTokenizer (using the default delimiters) to obtain a word count. Displays the result in a simple Swing dialog.
Issues: none
Top
Capitalisation
Author: Duncan FosterAim: Converts the selected text from upper case to first letter upper case, rest lower case, to lower case.
Language: BeanShell
Pre-requisites: none
Download: Capitalise.zip (2Kb)
Installation: no additional steps needed
Description: Uses the OpenOffice API to get the selected text (or makes a selection of the current word if no text selected), and then uses Java to change the case. Rotates from "THIS" -> "This" -> "this" -> "THIS". The script attempts to break up selected text into sentences using the Java StringTokenizer. The script also attempts to maintain the selection.
Issues: The script fails to maintain the selection if two separate areas of text are selected. For example, if the first and last words of the previous sentence were selected, only one (undefined) would remain selected after the script has been run.
Top
Post to Newsgroups
Author: Neil MontgomeryAim: Facilitates the posting of an OpenOffice document to a newsgroup.
Language: Java
Pre-requisites: none
Download: Newsgroup.zip (540Kb)
Installation: no additional steps needed
Description: The script will detect if a local installation of either Netscape or Mozilla has been used to subscribe to any newsgroups. These newsgroups will be listed for the user in a combo box. If no newsgroups are detected the user must supply the name of the newgroup and server. The user may also supply the reply-to address, subject and message body (in the comment text field). The user can also specify the format in which to send the attached document (the currently active document). If the document hasn't already been saved with a title, then the default name for the attachment(s) will be "Attachment.sxw" and/or "Attachment.html".
Issues: none.
Top
Scripting Framework Issuezilla Query -> Writer
Author: John RiceAim: Outputs the results of an Issuezilla query into the open Writer document.
Language: BeanShell
Pre-requisites: none
Download: SFBugsQueryIssuezilla.zip (2Kb)
Installation: The script sets a HTTP proxy on lines 43,44. The user will need to modify or remove these according to their local settings. The script also contains a certain amount of debug output which the user may want to remove.
Description: The script uses Java to open a HTTP connection to the OpenOffice.org website, passing a URL for an Issuezilla query for Scripting Framework bugs. The script then writes summary information for each bug into the open Writer document.
Issues: none.
Top
Scripting Framework Issuezilla Query -> Calc
Author: John RiceAim: Outputs the results of an Issuezilla query into the open Calc document.
Language: BeanShell
Pre-requisites: none
Download: SFBugsQueryIssuezillaCalc.zip (2Kb)
Installation: The script sets a HTTP proxy on lines 25,26. The user will need to modify or remove these according to their local settings.
Description: The script uses Java to open a HTTP connection to the OpenOffice.org website, passing a URL for an Issuezilla query for Scripting Framework bugs. The script then writes summary information for each bug into the open Calc document.
Issues: none.
Top
Insert Copyright Symbol
Author: Duncan FosterAim: Inserts a copyright symbol (or replaces the current selection with a copyright symbol).
Language: Beanshell
Pre-requisites: none
Download: InsertC.zip (4Kb)
Installation: No additional steps needed.
Description: Inserts a copyright symbol (or replaces the current selection with a copyright symbol).
Issues: None.
Top
Insert Trademark Symbol
Author: Duncan FosterAim: Inserts a trademark symbol (or replaces the current selection with a trademark symbol).
Language: Beanshell
Pre-requisites: none
Download: InsertTM.zip (4Kb)
Installation: No additional steps needed.
Description: Inserts a trademark symbol (or replaces the current selection with a trademark symbol).
Issues: None.
Top
Insert Hidden Text
Author: Duncan FosterAim: Inserts a hidden text field
Language: Beanshell
Pre-requisites: none
Download: InsertHiddenText.zip (4Kb)
Installation: No additional steps needed.
Description: Replaces the currently selected text with a hidden text field with the same contents.
Issues: None.
Top
Export To HTML
Author: John RiceAim: Saves a copy of the document in HTML format.
Language: Beanshell
Pre-requisites: none
Download: ExportToHTML.zip (4Kb)
Installation: No additional steps needed.
Description: Saves a copy of the document in the user's home directory in HTML format. Does not change the type of the current document (as happens with "Save As").
Issues: None.
Top
Combined Utilities
Aim: A zip file containing all of the scripts above.Download: all.zip (550Kb)
Top
Last Modified: Fri Jun 20 15:28:18 BST 2003