为什么此脚本添加不能从邮件规则运行?
当我访问 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
所以我尝试了一种解决方法:从内部告诉应用程序“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
So I tried a workaround: tell application "Finder" to ...
from within the Mail Rule script, but that then threw a security error.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这不是沙箱问题 - 这是 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.
鉴于这很可能是沙箱问题,我能想到的唯一解决方法是将计算放在 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