Created
December 4, 2017 22:40
-
-
Save datMaffin/c1998372ac5a148791e5fc276eb66992 to your computer and use it in GitHub Desktop.
Script to reload the PDF-viewer *Skim* in macOS
This file contains 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
#!/bin/bash | |
# the first argument should be the tex file, either with or without extension | |
file="$1" | |
[ "${file:0:1}" == "/" ] || file="${PWD}/${file}" | |
pdffile="${file%.tex}.pdf" | |
/usr/bin/osascript << EOF | |
set theFile to POSIX file "${pdffile}" as alias | |
tell application "Skim" | |
activate | |
set theDocs to get documents whose path is (get POSIX path of theFile) | |
if (count of theDocs) > 0 then revert theDocs | |
open theFile | |
end tell | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment