在 Safari 或 Google Chrome 中獲取當前網址

終端命令列

Safari 獲取當前 URL ****

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

獲取 Google Chrome 中有效網址 ****

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