我提出这个问题的动机是下面的文档,它描述了如何使用ScriptingBridge集成mail.app:
http://developer.apple.com/mac/library/samplecode/SBSendEmail/Introduction/Intro.html
我也尝试将类似的技术应用于Entourage,但到目前为止还没有得到任何结果。我知道使用AppleScript将帮助我解决我的问题,并且mactech.com有大量的文档可以做到这一点。
但我发现这种ScriptingBridge技术很优雅,并想弄清楚为什么它在我的Entourage中不起作用。
最大的问题似乎是我无法创建基于它们的名称的脚本类,因为正如它们的头所示,Entourage具有与Mail不同的接口。
有没有人能告诉我我遗漏了什么,或者提供任何关于为什么这个不起作用的提示?
我还添加了示例代码
`
MicrosoftEntourageApplication * mail = [SBApplication
applicationWithBundleIdentifier:@"com.Microsoft.Entourage"];
MicrosoftEntourageOutgoingEmailMessage * emailMessage =
[[[mail classForScriptingClass:@"outgoing message"] alloc]
initWithProperties:
[NSDictionary dictionaryWithObjectsAndKeys:
@"my sample subject", @"subject",
@"my sample body", @"content",
nil]];
//then i create a set of recipients and try to use "to recipient" as the string scripting class id, but MicrosoftEntourageRecipient is returned as nil
MicrosoftEntourageRecipient * theRecipient =
[[[mail classForScriptingClass:@"to recipient"] alloc]
initWithProperties:
[NSDictionary dictionaryWithObjectsAndKeys:
@"johndoe@adobe.com", @"address",
nil]];`
我在试着把简单的事情做好,我甚至没有把注意力集中在我现在应该做的事情上。
我是一个Cocoa初学者(并且愿意学习),除了回答我的问题之外,请原谅语法上的幼稚,并在示例代码中指出它们。
诚挚的问候,
Subramanian
发布于 2010-06-02 02:09:53
以下是一些事情:
https://stackoverflow.com/questions/2947576
复制相似问题