2

在以前版本的 LibreOffice 中,可以从“插入”菜单将脚本插入 odt。

根据官方回答,此功能已被删除: https ://ask.libreoffice.org/en/question/67576/menu-insert-script-removed/

那么我应该如何插入脚本?什么是“Writer HTML”,这个答案暗示了什么?我在其他任何地方都找不到关于它的消息。

如果我想避免挖掘大量 XML,我是否被迫安装早期版本的 LibreOffice 只是为了这个功能?

另外,任何人都可以解释这一举动的原因(从产品中删除现有的、方便的功能)吗?

4

2 回答 2

4

要在 Writer 中创建 HTML 文档(即“Writer HTML”),请转到File -> New -> HTML Document,然后可以插入脚本。或者,听起来您可能想要File -> New -> XML Form Document

在我看来,Insert -> Script它只对添加 Javascript 或类似文档有用,这似乎适用于 HTML 文档或表单。所以新的变化对我来说很有意义。

要编写 Javascript,请将代码放在 LibreOffice 用户目录下的文本文件中,如此所述。

编辑

从下面的评论中,听起来您正在插入一个与 JODReports 一起使用的指令。您能否改为执行以下操作:

在 OpenOffice.org Writer 中从菜单 Insert / > Fields / Other... 中插入 FreeMarker 指令(或只需按 Ctrl+F2),然后单击 Functions 选项卡并 > 选择 Input field。将字段 Reference 更改为 JOOScript 并在 > 以下字段 Content 中输入指令(例如“[#assign title='Mr.']”)。

注意:Apache OpenOffice 仍然有Insert -> Script.

于 2016-04-28T20:54:08.463 回答
2

脚本功能仍然存在。它只是不在默认菜单中。转至 Scripting LibreOffice将其添加回“插入”菜单项。

这是添加它的一种方法(使用版本:5.3.2.2 完成):

  1. 选择工具 - 自定义,然后单击菜单选项卡。
  2. LibreOffice Writer 菜单中,向下滚动到插入。
  3. In Menu Content - Entries, scroll down to any item after which you want the Script item to appear.
  4. Click Add Commands.
  5. In the Category list box, choose All catgories.
  6. In the Commands list box, scroll down to Script
  7. Click Add to create a new menu item. The new menu entry appears in the Entries list box.
  8. Click OK and you are ready to insert a new script object anywhere.
于 2018-07-04T14:19:32.697 回答