Last active
February 7, 2018 21:05
-
-
Save alcides/48ff113d6e600589d794d0786da2788c to your computer and use it in GitHub Desktop.
Automatically refreshes top-most Safari tab
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
# Dependencies: | |
# > brew install watch markdown | |
# Usage: | |
# > bash automarkdown.sh Readme.md | |
MDFILE=/tmp/preview.html | |
touch $MDFILE && open $MDFILE | |
watch "markdown $@ > $MDFILE && osascript -e 'if application \"Safari\" is running then | |
tell application \"Safari\" | |
set sameURL to URL of current tab of front window | |
set URL of current tab of front window to sameURL | |
end tell | |
end if'" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment