传达我的问题的动机是下面的文档,其中描述了如何mail.app可以使用ScriptingBridge集成:使用ScriptingBridge框架与Entourage
http://developer.apple.com/mac/library/samplecode/SBSendEmail/Introduction/Intro.html
我试图申请与Entourage类似的技术而且目前还没有取得任何成果。我知道使用AppleScript将帮助我解决问题,而mactech.com为此提供了大量文档。
但我觉得这个ScriptingBridge技术优雅,想弄清楚为什么它不适合我与Entourage。
最大的问题似乎是我无法根据它们的名称创建脚本类,因为它发生在Mail中,因为Entourage与它们的标题所指示的具有不同的接口。
有人能告诉我我缺少什么或提供任何形式的暗示,为什么这不会工作?
我也在示例代码
`
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:
@"[email protected]", @"address",
nil]];
`
我试图让简单的事情工作,我甚至不集中的任务,我该怎么办现在。
我是可可初学者(并愿意学习),请原谅一个句法天真,并在示例代码中指出它们,除了回答我的问题。
最好的问候,
萨勃拉曼尼亚
感谢您的回答,我让它通过AppleScript工作,并使用NSAppleScript我也能够在我的应用程序中执行。所以,我想我会继续解决这个问题。 – subramanian 2010-06-02 07:10:33