开发者

Why won't this Scripting Addition run from a Mail rule?

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

Why won't this Scripting Addition run from a Mail rule?

开发者_运维问答

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


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.

Why won't this Scripting Addition run from a Mail rule?


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜