How can I get the location of the current tab of the frontmost window of Safari in a shell script?
1 Answer
I created the following shell script at ~/bin/currenturl
:
osascript -e 'tell application "Safari" to return URL of front document' | tr -d '\n'
(and chmod +x
'd it of course.)