在 macOS 上以编程方式打开关于 App window

Open About App window programmatically on macOS

在MacOSX上,每个应用都有一个"About"window,点击[=12=中的About [appname]即可打开] 菜单栏中的菜单。

我想以编程方式打开此 window。这可能吗?

EG:iTunes 的“关于”按钮:

About 菜单项连接到 NSApplicationorderFrontStandardAboutPanel 方法,您可以使用

以编程方式调用它
[NSApp orderFrontStandardAboutPanel:self]; // or nil as parameter

或在Swift

NSApp.orderFrontStandardAboutPanel(self) // or nil as parameter