objective-c - SB应用程序: how to send raw data

标签 objective-c cocoa appleevents scripting-bridge

我想使用 SBApplication sendEvent 发送原始数据(void*)

不幸的是,我没有找到与此相关的文档。

您有什么想法来实现这一目标吗?

预先感谢您的帮助,

问候,

最佳答案

sendEvent:id:parameters: 实际上是所有 SBObject 响应的消息,而不仅仅是 SBApplications。 SBObject.h 说:

// Send an Apple event.  The direct parameter is the specifier of the receiver if it
// is non-null.  Other parameters are given using "parameters:" as a list of pairs
// of the parameter four-byte code followed by an Objective-C object; use a parameter
// code of 0 to mark the end of the list.

因此,尝试将数据装箱到 NSData 对象中,然后传递该对象。

关于objective-c - SB应用程序: how to send raw data,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3816193/

相关文章:

objective-c - 如何将 "Cmd-C"击键发送到 Objective-C 中的事件应用程序,或者告诉应用程序执行复制操作?

ios - 代码优化(2行代码合并为1行)

ios - Hello World Objective-C 问题

objective-c - 设置 QuickLook 插件的窗口大小

objective-c - 代码 : How to handle Space character in string?

cocoa - 如何通过 ScriptingBridge 使用 AppleScript 获取终端窗口的窗口 ID 和选项卡号?

macos - 在 Cocoa 中回复 Apple 事件

ios - 以秒、分钟、小时为单位的耗时

ios - 用于移动 Web 开发的 Objective C

iphone - NSClassFromString 不区分大小写的 Objective-C