Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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
share|improve this question
1  
Why not use AntiRSI tech.inhelsinki.nl/antirsi ? –  user588 May 15 '12 at 22:16
    
@mankoff, for the fun of writing my own... –  lhf May 15 '12 at 22:26

1 Answer 1

I've found a way. Does anyone way 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'.

share|improve this answer
1  
You can. At least kind of... stackoverflow.com/questions/8215501/… –  Max Ried May 15 '12 at 13:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.