Created
June 20, 2014 07:10
-
-
Save cmittendorf/40e68cba8bcf5ff12ff5 to your computer and use it in GitHub Desktop.
Get the URL of the current web page from Safari
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
URL=$(osascript << EOF | |
tell application "Safari" | |
tell its first document | |
URL | |
end tell | |
end tell | |
EOF) | |
echo -n ${URL%\\n} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment