Skip to content

Instantly share code, notes, and snippets.

@jasper-lyons-rhul
Created May 15, 2018 13:35
Show Gist options
  • Save jasper-lyons-rhul/2b4c1e0c891be869858328ac4624de26 to your computer and use it in GitHub Desktop.
Save jasper-lyons-rhul/2b4c1e0c891be869858328ac4624de26 to your computer and use it in GitHub Desktop.
Reload firefox window on mac os
fswatch -x --event Updated ./templates | while read file event ; do
if [[ $file = *".mjml" ]]; then
file_name=${file%.mjml}".html"
mjml $file > $file_name
osascript -e '
set previous to (path to frontmost application)
tell application "Firefox Developer Edition"
activate
tell application "System Events" to keystroke "r" using command down
end tell
tell application (previous as text)
activate
end tell
'
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment