Frequently Asked Questions for the Office Scripting Framework
Questions
Why can't I see the script I deployed to a document from the [Assign Script] dialog?
How can I store menu or key bindings for scripting in a document?
Answers
Why can't I see the script I deployed to a document from the [Assign Script] dialog?
Currently, the [Assign Script] dialog only displays scripts located in the user area (also, the IDE only supports deployment to document and user area). This will be fixed in the next release.
Workaround: To bind to scripts deployed in the application share area you can hand edit the appropriate (app)keybinding.xml or (app)menubinding.xml file located in the /user/config/soffice.cfg/ directory. Changes to these files require a restart of the application to take effect.
Why can't I bind scripts to events?
This is the first release of the scripting framework, some work is still needed in the office source in order to support scripting fully. In particular the way events are handled is different to how menu and keybindings are handled and currently we cannot support event bindings. It is our intention to add this functionality in the future.
I have removed the examples provided with the Script Framework installation and installed my own but the script in ExampleSpreadSheet.sxc still works. Why?
Both the script and the Key bindings are contained in the document itself, at the moment the [Assign Script] dialog does not display scripts or bindings stored in documents.
How can I store a script, menu or key bindings for scripting in a document?
To store bindings in document follow the steps below;
Use the IDE deploy the Script to the user area as well as to the document.
Create the binding (key or menu) as normal using the [Assign Script] dialog to the user script which matches that in the document.
Restart office.
Select [Configure] from the [Tools] menu, select the appropriate tab (Keyboard or Menu). Click on the save button and select the document you wish to save the bindings to.
Due to an issue with deploying to document from an ide a couple of extra manual steps are needed.
You need to extract the parcel-descriptor file from the document you deployed to.
Edit the parcel-descriptor.xml file you have extracted and modify the line:
<prop name="classpath" value="."/>” to be <prop name="classpath" value=""/>
Save the updates.
Update the document with the “parcel-descriptor.xml” you have just modified
On Solaris/Linux use:
zip <path to document> Scripts/java/<ParcelName>/parcel-descriptor.xml
On windows refer to the user documentation for your Zip/unZip utility on how to update files in an archive.
You now have a key or menu binding for this script stored in the document along with the script. The ability to add document bindings directly will be added in the future.
Why is there a delay in starting the first script?
The delay is caused by the startup of the inprocess JVM by office.
Why do I have to use one dialog to work with StarBasic macros [Tools/ Configure] and another to work with my new Java scripts [Assign Script...]?
The StarBasic macros are completely separate from and do not use the Scripting Framework. As such they use their own configuration and settings dialogs. In the future the Scripting Framework and StarBasic dialogs will be integrated so users have one consistnet way of working with macros/ scripts, regardless of which language they have been written it.
Last Modified: Fri Nov 29 15:18:53 GMT 2002