MacOS – Open PDF in full screen from the command line

command linefullscreenmacospreview

I've written a simple-minded "take a break" reminder which just opens a PDF notice. This works fine, but I wish I could open the PDF file in full screen mode from the command line. Does anyone know how to do that? Perhaps some osascript magic?

#!/bin/sh
B=$HOME/Documents/break.pdf
D=3000
while true
do
        sleep $D
        open $B
done

Best Answer

I've found a way. Does anyone know a simpler way?

tell application "Preview"
        activate
end tell

tell application "System Events"
        key down {command}
        key down {shift}
        keystroke "f"
        key up {shift}
        key up {command}
end tell

I wish I could do simply "osascript -e 'application "Preview" to fullscreen'.