【发布时间】:2019-08-06 10:37:11
【问题描述】:
我正在使用以下内容:
tell current application's NSAlert's alloc's init()
its setMessageText:"Alert test"
its setInformativeText:"This is a test"
its setAlertStyle:2
its setShowsSuppressionButton:true
its addButtonWithTitle:"Cancel"
its addButtonWithTitle:"Replace"
its beginSheetModalForWindow:theWindow modalDelegate:me didEndSelector:(missing value) contextInfo:(missing value)
end tell
我想知道如何获取单击按钮的值,包括“抑制按钮”。 提前谢谢!
【问题讨论】:
-
这是针对 Xcode 项目的吗?在我的 Sierra 和 Mojave 系统上,使用
didEndSelector会在使用除默认按钮以外的任何其他内容时使应用程序崩溃,因此看起来早期的错误又回来了 - 虽然通过 Myriad Helpers 类别使用基于块的方法工作正常。 -
是的,它是针对一个xcode项目的,有什么办法吗?
标签: applescript-objc