Bash 如何从终端打开私人Safari窗口?

Bash 如何从终端打开私人Safari窗口?,bash,safari,terminal,Bash,Safari,Terminal,为了在我的终端上通过Safari打开一个链接(例如Google),我写道: open -a safari https://google.com 如果我想在专用窗口而不是标准窗口上打开此链接,是否有方法或标志从终端启用此链接 此方法要求用户启用系统事件的可访问性模式,它将向用户显示一个对话 您可以在终端中使用AppleScript执行所需操作: osascript -e 'tell application "Safari" to activate tell application "System

为了在我的终端上通过Safari打开一个链接(例如Google),我写道:

open -a safari https://google.com

如果我想在专用窗口而不是标准窗口上打开此链接,是否有方法或标志从终端启用此链接

此方法要求用户启用系统事件的可访问性模式,它将向用户显示一个对话

您可以在终端中使用AppleScript执行所需操作:

osascript -e 'tell application "Safari" to activate
tell application "System Events"
tell process "Safari"
click menu item "New Private Window" of menu "File" of menu bar 1
end tell
end tell'