如何创建可用于沙箱的基于Automator的“替换文本”服务?


2

我想在macOS 10.12.6上使用Automator创建服务。

我选择了:

服务会在任何应用程序中接收所选的富文本格式 输入就是整个选择 ☑️输出会替换所选的文本

然后,我计划使用AppleScript转换文本。很容易,对吧?但是我已经使用这种方法创建了多个服务,当我在TextEdit中选择它们时,所有服务都会失败。我暂时看到了微调器图标,但没有显示错误对话框。

在Console.app中,我看到此错误:

sandboxd
Subsystem: com.apple.sandbox.reporting Category: violation
SandboxViolation: TextEdit(11092) deny file-read-data /Users/somebody/Library/Services/Demo.workflow
Violation: deny file-read-data /Users/somebody/Library/Services/Demo.workflow

如何使我的服务符合沙盒限制?


如果将其设置为接收富文本格式,则可以复制该错误。如果将其设置为接收文本,它将消失。您是否有特定的原因需要使用富文本格式?据我所知,“运行AppleScript”参数无法理解富文本格式。
赫斯顿,

@Hurston是的。如果选择“文本”,则不会遇到相同的沙箱问题。不幸的是,如果我选择此选项,该服务然后会将原始RTF标记输出到我的RTF文档中。(我想更改字体,类似于此答案。)
Jacob Budin
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.