为什么此脚本添加不能从邮件规则运行?

发布于 2024-09-30 21:33:55 字数 562 浏览 2 评论 0原文

当我访问 satimage.osax 脚本添加(我是使用其正则表达式功能)从 Snow Leopard 上的邮件规则中,我收到错误,但它在脚本编辑器中运行良好。下面的代码说明了这个问题。第一行执行得很好,但是 tell 块内的行从邮件规则版本中抛出一个错误(如下),我已经捕获了该错误。

set substr to find text "a" in "abcd"

tell application "Mail"
    set substr to find text "a" in "abcd"
end tell

alt text

所以我尝试了一种解决方法:从内部告诉应用程序“Finder”...邮件规则脚本,但这随后引发了安全错误。

When I access the satimage.osax scripting addition (which I'm using for its regex capability) from a Mail rule on Snow Leopard, I get errors, but it runs fine in Script Editor. The code below illustrates the problem. The first line executes fine, but the line inside the tell block throws an error (below), from the mail rule version, which I had catching the error.

set substr to find text "a" in "abcd"

tell application "Mail"
    set substr to find text "a" in "abcd"
end tell

alt text

So I tried a workaround: tell application "Finder" to ... from within the Mail Rule script, but that then threw a security error.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

乱世争霸 2024-10-07 21:33:55

这不是沙箱问题 - 这是 32/64 位问题。 Mail 是 Snow Leopard 中的 64 位应用程序,截至目前,Satimage .osax 是 32 位添加。因此,我暂时将“邮件”设置为以 32 位模式打开(见图)。我在阅读 MacScripter 论坛帖子后得出了这个结论。我仍然希望听到另一种解决方法,以防 Satimage 保持 32 位附加功能。
替代文本

It's not a sandboxing problem - it's a 32/64 bit problem. Mail is a 64-bit application in Snow Leopard, and as of right now, Satimage.osax is a 32-bit addition. So for the time being, I set Mail to Open in 32-bit mode (see picture). I arrived at this conclusion after reading a MacScripter forum post. I'd still love to hear another workaround, in case Satimage stays a 32-bit addition.
alt text

乜一 2024-10-07 21:33:55

鉴于这很可能是沙箱问题,我能想到的唯一解决方法是将计算放在 Mail (2) 之外的脚本或脚本应用程序 (1) 中,从 Mail 调用that,然后处理返回的结果。

(1) 哪种情况最适合这种情况。

(2) 您的 User Scripts 文件夹将是一个好地方

Given this is more than likely a sandboxing issue the only workaround I can think of is to place the calculations in a script or script application(1) outside of Mail (2), call that from Mail, and handle a returned result.

(1) Whichever works best for this situation.

(2) Your User Scripts folder would be a good place for this

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文