通过命令行在macOS上打开URL
如何通过命令行上的MacOS在MacOS上打开一个URL?
How can I open a URL on macOS via the command line?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
如何通过命令行上的MacOS在MacOS上打开一个URL?
How can I open a URL on macOS via the command line?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
我找到了通过命令行1在MACOS上打开URL的两种方法
。
I have found two ways to open a URL on macOS via command line
1.
通过AppleScript知道,可以直接打开URL。默认浏览器将被触发。无需明确调用Safari。
Is Known by AppleScript and can open the url directly. The default browser will be triggered. No need to invoke Safari explicitly.
该苹果公司将仅启动Safari ,即使不是默认的浏览器,也将使用所需的URL将其带到前景。
这样通过osascript运行它:
This AppleScript will launch Safari only and bring it to the foreground with the desired URL even when it is not the default browser.
Run it via osascript like this: