在 Safari 或 Google Chrome 中获取当前页面的标题

Safari 中获取网页的名称 ****

osascript -e 'tell app "safari" to get the name of the current tab of window 1'

Google Chrome 中获取网页标题 ****

osascript -e 'tell app "google chrome" to get the title of the active tab of window 1'