在 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'