是否可以使用 Apple Events 与来自 C 或 D 的应用程序进行通信?

编程入门 行业动态 更新时间:2024-10-16 08:29:47
本文介绍了是否可以使用 Apple Events 与来自 C 或 D 的应用程序进行通信?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我希望通过 Apple Events 与 D 应用程序(可以与 C 互操作)中的其他应用程序进行交互没有嵌入 AppleScript、JSX 等的系统.关于从非 AppleScript 应用程序发送 Apple Events 的主题的文档很少,我找不到任何关于从 C 应用程序实现这一点的信息,更不用说 D 应用程序了.有可能吗,如果有,怎么做?

解决方案

这是这些事件的 C API 的文档.

不幸的是,该 API 是 Carbon 的一部分,从 OS X 10.8 开始,它显然不再工作了.相同的 C API 现在公开给 Objective C 和 Swift,并且仍然受支持.例如.AECreateDesc 也是一样,AEBuildAppleEvent 变成了 vAEBuildAppleEvent,依此类推.请参阅此页面了解文档,您需要以 AE 开头的函数/结构.>

现在你有另一个问题,如何在 C/D 和 ObjC/Swift 之间进行互操作.如果您可以使用 XCode,则可以在一个项目中混合使用多种语言,请参阅此答案.

I am looking to interact with other applications from a D application (which can interop with C) through the Apple Events system without embedding AppleScript, JSX or the like. There are few documents on the subject of sending Apple Events from non-AppleScript applications, and I can't find any information on achieving this from a C application, let alone a D application. Is it possible, and if so, how?

解决方案

Here’s the documentation for the C API for these events.

Unfortunately, that API is part of Carbon, which apparently doesn’t work anymore, since OS X 10.8. The same C API is now exposed to Objective C and Swift, and is still supported. E.g. AECreateDesc is the same, AEBuildAppleEvent becomes vAEBuildAppleEvent, and so on. See this page for documentation, you’ll want functions/structures that begin with AE.

Now you have another problem, how to interop between C/D and ObjC/Swift. If you’re OK using XCode, you can mix the languages in a single project, see this answer.

这篇关于是否可以使用 Apple Events 与来自 C 或 D 的应用程序进行通信?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-17 13:49:43,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/915829.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:可以使用   应用程序   通信   Events   Apple

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!