是否可以使用Apple Events与C或D中的应用程序进行通信? [英] Is it possible to use Apple Events to communicate with applications from C or D?

查看:197
本文介绍了是否可以使用Apple Events与C或D中的应用程序进行通信?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望通过Apple Events通过 D 应用程序(可以与C互操作)与其他应用程序进行交互.系统,而无需嵌入AppleScript,JSX等.关于从非AppleScript应用程序发送Apple事件的文档很少,而且我找不到从C应用程序实现此目的的任何信息,更不用说D应用程序了.有可能,如果可以,怎么办?

解决方案

此页面以获取文档,您将需要以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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆