使用者 Guide for the Office Scripting 枠組み
Contents
Pre-requisites
Before you 任命する/導入する the Scripting 枠組み, be aware of the に引き続いて:
-
This is an 早期に Developer 解放(する) of the Office Scripting 枠組み 供給するd for 使用者s and developers of OpenOffice.org to try out and 供給する feedback. 未来 解放(する)s of the 枠組み may change.
-
This 解放(する) of the Scripting 枠組み runs only on OpenOffice.org 1.1 rc and above.
-
The Scripting 枠組み is 現在/一般に 利用できる in English only.
Binding Office Scripts
The 死刑執行 of Office scripts can be bound to menu and 重要な items and also to 使用/適用 or 文書 events. These bindings can be defined 経由で a 始める,決める of 割り当てる dialogs which can be started from the 道具s/Scripting 追加する-on's menu
割り当てるing scripts to Menu and 重要な items
The dialog shown below is the 割り当てる Script to Menu dialog. This dialog is 類似の in design and 機能(する)/行事 to the 割り当てる Script to 重要な dialog and the 指示/教授/教育s below should be seen to 適用する also to the 割り当てる Script to 重要な dialog.
-
場所
The 場所 combo box will be 居住させるd with “使用者”,”株”, “文書” or "Filesystem" the default value will be “使用者” which will 陳列する,発揮する all scripts (with the selected language type) in the “使用者” area.
-
Language
The language combox is 居住させるd with the 名簿(に載せる)/表(にあげる) of supported languages. The default language is 始める,決める to Java.
-
Script ListBox
Only necessary (警察などへの)密告,告訴(状) will be 陳列する,発揮するd, logicalname will always be 陳列する,発揮するd, if the “詳細(に述べる)d 見解(をとる)” check box is selected the scripts will be 陳列する,発揮するd as follows “logicalname [functionname]”
- Browse
A new feature in the 0.3 解放(する) is the ability to 貯蔵所d to scripts on the filesystem (without an associated 小包-descriptor.xml). Clicking [Browse] pops up a filechooser dialog enabling the 使用者 to 居住させる the Script ListBox. As the Java Script Runtime (not to be 混乱させるd with the JavaScript Script Runtime!!) does not support running scripts from the Filesystem, the Browse button is enabled only when the 場所 combo box is 始める,決める to "Filesystem", and Language combo box is 始める,決める to something other than "Java".
-
New
This button will not be selectable unless a script from the script ListBox and a menu 指名する is entered in the new menu text box (opposite New button), clicking [New] creates a binding between two.
-
削除する
This button will not be selectable unless a sub menu with a script binding is selected, clicking [削除する] 除去するs the binding.
-
承認する
Clicking [承認する] commits all of the changes the 使用者 has made
-
取り消す
配置する/処分する/したい気持ちにさせるs the dialog without committing any changes.
-
Help
Will 陳列する,発揮する a dialog 述べるing how to use each of the “割り当てる Script” dialogs.
公式文書,認める: Unlike StarBasic it will not be possible to 体制/機構 a 重要な binding that 適用するs for the whole Office 控訴 – 重要な bindings can only be 体制/機構 for an 使用/適用 or a 文書 of that 使用/適用 type.
割り当てるing scripts to events
-
Browse
A new feature in the 0.3 解放(する) is the ability to 貯蔵所d to scripts on the filesystem (without an associated 小包-descriptor.xml). Clicking [Browse] pops up a filechooser dialog enabling the 使用者 to 居住させる the Script ListBox. As the Java Script Runtime (not to be 混乱させるd with the JavaScript Script Runtime!!) does not support running scripts from the Filesystem, the Browse button is enabled only when the 場所 combo box is 始める,決める to "Filesystem", and Language combo box is 始める,決める to something other than "Java". -
Event ListBox
The ListBox will be 居住させるd with the 名簿(に載せる)/表(にあげる) all event types, if a script has already been 割り当てるd to an event the 存在するing binding is 陳列する,発揮するd as follows
Event [ script URI ]
example:
Start 使用/適用 [script://Highlighter.BeanShell?language=BeanShell&機能(する)/行事=highlighter.bsh&場所=使用者]
-
無線で通信する Buttons
By default the “文書” 無線で通信する button is selected, if selected the event binding is for this 文書 only. If “All 使用/適用s” is selected then the event binding is for all 文書s of all 使用/適用 types ( writer, calc etc. )
-
割り当てる
This button will not be selectable unless a script from the script ListBox and event from the event ListBox are 最高潮の場面d (selected), clicking [割り当てる] creates a binding between two.
-
削除する
This button will not be selectable unless an event with a script binding from the event ListBox is selected, clicking [削除する] 除去するs the binding.
-
承認する
Clicking [承認する] commits all of the changes the 使用者 has made
-
取り消す
配置する/処分する/したい気持ちにさせるs the dialog without committing any changes.
-
Help
Will 陳列する,発揮する a dialog 述べるing how to use each of the “割り当てる Script” dialogs.
Other Scripting-追加する'ons Menu Items
Two other menu items are 利用できる under the 道具s/Scripting 追加する-on's submenu:
-
Edit/Debug Scripts - This pops up a dialog in which the 使用者 can 実験 with 令状ing and 遂行する/発効させるing JavaScript & BeanShell code. As with the 割り当てる dialogs, the [Browse] button 許すs the 使用者 to select scripts 位置を示すd on the filesystem. (and is only enabled under the same 条件s as in the 割り当てる dialogs). See 令状ing Scripts in BeanShell and Java for more (警察などへの)密告,告訴(状) on using this window.
-
Refresh All Scripts - This is used to refresh the script 名簿(に載せる)/表(にあげる)s that appear in the 割り当てる dialogs after new scripts have been (軍隊を)展開する,配備するd into your OpenOffice.org 取り付け・設備 or 文書s.
Running the example Office Scripts
There are two examples scripts 供給(する)d with the Scripting 枠組み, 最高潮の場面 and MemoryUsage. 最高潮の場面 is an 使用/適用 level script for Writer that 許すs the 使用者 to search for a word or phrase. It will 最高潮の場面 all instances in red and give a count of the number of instances.
The second example, MemoryUsage, is a script 蓄える/店d in a Calc spreadsheet that checks the 現在の memory usage in the Java 事実上の Machine and updates 独房s in the spreadsheet with the usage values. The spreadsheet also 含む/封じ込めるs a graph which will update when the 独房 values are changed.
The examples are 利用できる for both Java and BeanShell in the language directories created under <Office 取り付け・設備>/使用者/Scripts by the installer.
Running the 最高潮の場面 example
To run this example you first need to create a menu item from which you can 遂行する/発効させる the script.
-
Start OpenOffice.org and open an 存在するing Writer 文書 or create a new one.
-
Select the menu item 道具s/Scripting 追加する-on's/割り当てる Scripts To Menu...
-
In the "割り当てる Scripts To Menu" dialog that pops up do the に引き続いて:
-
Select 場所 and language
-
始める,決める the 場所 to 使用者 and the language to Java in the 減少(する) 負かす/撃墜する 名簿(に載せる)/表(にあげる)s.
-
-
Select script
-
Select the script HighlightText.showForm from the 名簿(に載せる)/表(にあげる).
-
-
Choose the menu to 挿入する the script menu after
-
Select the 最高の,を越す level menu and submenu under which you want to place your new menu item.
-
-
割り当てる script to new menu
-
In the New Menu text field enter the label you want for your menu item (eg. 最高潮の場面)
-
Click New Script Menu to create the new script menu item.
-
-
-
Finally click on the 承認する button to save your new script menu item.
-
Your new menu item will now be 利用できる and clicking on it will invoke the script.
-
You should see a 最高潮の場面 Text dialog appear which you can use to 最高潮の場面 さまざまな text strings you are looking for in the 文書.
Running the MemoryUsage example
The Java 見解/翻訳/版 of the MemoryUsage example is already (軍隊を)展開する,配備するd inside an Office 文書, ExampleSpreadSheet.sxc. To run the Java example, just open:
<Office 取り付け・設備>/使用者/Scripts/java/ExampleSpreadSheet.sxc.
You can then 遂行する/発効させる the MemoryUsage script by 圧力(をかける)ing CTRL+転換+M
with the ExampleSpreadSheet.sxc window 焦点(を合わせる)d. You should see the
memory usage values 存在 updated, and the graph should change to
反映する the new values.
Running the ExportSheetsToHTML
example
To run this example you first need to create or open an 存在するing
spreadsheet 文書. If you have created a new 文書 save it (eg.
c:\temp\mycalcdoc.sxc)
- Select the menu item 道具s->Scripting 追加する-ons->割り当てる Script to 重要な
- Select the 場所 "使用者", and language "JavaScript.
- Select the example script ExportSheetsToHTML.JavaScript
- Select the 重要な group CONTROL + letters, and then select the Shortcut 重要な CONTROL + H
- 圧力(をかける) the 割り当てる button, and then the 承認する button.
てこ入れ/借入資本ing StarBasic 安全
As part of the 早期に Developer 解放(する)
v0.2 of the Scripting 枠組み, we have 試みる/企てるd to mimic the
安全
settings for StarBasic. The settings 許す the 使用者 to 支配(する)/統制する
the
死刑執行 of 大型のs 現在の in OpenOffice.org 文書s. 設立する in
the 道具s->選択s dialog under
OpenOffice.org->安全, these settings 許す the 使用者
to 明示する the 条件s under which it is permissable to 遂行する/発効させる
文書 based StarBasic 大型のs. The settings in this dialog now 適用する
to both StarBasic 大型のs and Scripting 枠組み scripts.
A 十分な description of how these settings work can be 設立する by clicking
the "Help" button in the dialog, and then clicking "OpenOffice.org",
and
"安全" in the left-手渡す pane of the Help dialog. The possible
シナリオs associated with the 安全 settings are summarised in the
(米)棚上げする/(英)提議する below.
"Run 大型の" |
"確認する in the 事例/患者 of other 文書 sources" |
"Show 警告 before Running" |
文書 path in "Path 名簿(に載せる)/表(にあげる)" |
Behaviour |
---|---|---|---|---|
Never |
N/A |
N/A |
N/A |
大型のs never run. No 警告 陳列する,発揮するd. |
によれば path 名簿(に載せる)/表(にあげる) |
No |
No |
No |
大型のs never run. No 警告 陳列する,発揮するd. |
によれば path 名簿(に載せる)/表(にあげる) |
No |
No |
Yes |
大型のs run. No 警告 陳列する,発揮するd. |
によれば path 名簿(に載せる)/表(にあげる) |
No |
Yes |
No |
大型のs never run. No 警告 陳列する,発揮するd. |
によれば path 名簿(に載せる)/表(にあげる) |
No |
Yes |
Yes |
警告 陳列する,発揮するd on 文書 負担. If "Run" button clicked 大型のs will run, さもなければ they will not. |
によれば path 名簿(に載せる)/表(にあげる) |
Yes |
No |
No |
警告 with checkbox to 追加する path to path 名簿(に載せる)/表(にあげる) is 陳列する,発揮するd on 文書 負担. If "Run" button clicked 大型のs will run, さもなければ they will not. 関わりなく which button is clicked, if checkbox is ticked 文書 path is 追加するd to "Path 名簿(に載せる)/表(にあげる)". |
によれば path 名簿(に載せる)/表(にあげる) |
Yes |
No |
Yes |
大型のs run. No 警告 陳列する,発揮するd. |
によれば path 名簿(に載せる)/表(にあげる) |
Yes |
Yes |
No |
警告 with checkbox to 追加する path to path 名簿(に載せる)/表(にあげる) is 陳列する,発揮するd on 文書 負担. If "Run" button clicked 大型のs will run, さもなければ they will not. 関わりなく which button is clicked, if checkbox is ticked 文書 path is 追加するd to "Path 名簿(に載せる)/表(にあげる)". |
によれば path 名簿(に載せる)/表(にあげる) |
Yes |
Yes |
Yes |
警告 陳列する,発揮するd on 文書 負担. If "Run" button clicked 大型のs will run, さもなければ they will not. |
Always |
N/A |
No |
N/A |
大型のs run. No 警告 陳列する,発揮するd. |
Always |
N/A |
Yes |
N/A |
警告 陳列する,発揮するd on 文書 負担. If "Run" button clicked 大型のs will run, さもなければ they will not. |
Different behaviour in the Scripting 枠組み
The Script 安全 has one 重要な difference in behaviour to
the StarBasic 安全. In the Scripting 枠組み the 安全 警告
dialogs are 陳列する,発揮するd only upon the first script invocation on a
文書 含む/封じ込めるing scripts, unlike StarBasic where the dialogs are
陳列する,発揮するd on 負担ing a 文書 含む/封じ込めるing 大型のs.
If the settings are "Always", and "Show 警告 Before Running", when
負担ing a 文書 含む/封じ込めるing 大型のs the StarBasic dialog 陳列する,発揮する is
incorrect (the dialog 陳列する,発揮するd is more appropriate to the "(許可,名誉などを)与えるing
To
Path 名簿(に載せる)/表(にあげる)" setting). This has been logged as 問題/発行する
11822, the 直す/買収する,八百長をする for which is not in the OpenOffice.org 1.1 beta
解放(する). Under the Scripting 枠組み the 訂正する dialog is 陳列する,発揮するd.
最高の,を越す
Troubleshooting
See the 解放(する) 公式文書,認めるs page.
Last 修正するd: Tue Jul 15 16:16:07 BST 2003