|
|
Force Preview to reload a document
I wrote a new script, based on alblue's hint. It requires that you setup alblue's keyboard shortcut:
Firstly, you don't need a script to do this. There's a Revert menu under the File view, and this allows you to reload the document. It's also trivial to bind it to a keystroke, since you can open up System Preferences, go to the Keyboard and Mouse pane, and then in the Keyboard Shortcuts page, click on [+] to add a new shortcut. Simply choose 'Preview' and then type in 'File' and 'Revert' in the boxes (assuming that you're running in English) and a suitable keystroke (I used Command+Shift+R). IIRC you have to restart Preview to get the new binding (after saving the keystrokes by closing System Preferences first!). My script either loads the document, or reverts it, and makes it the foremost window. Additionally, it jumps to the page that was last viewed (but it assumes that your Preview has the standard toolbar layout so that it can tab around the tool bar, because AppleScript sucks). I integrate this script into my LaTeX build process. I execute: make preview-paper.pdf where I'm compiling paper.tex to paper.pdf. The Makefile has a rule like this:
and the following AppleScript is saved as tools/preview-revert.scpt:
Now I want to cleanse myself of AppleScript (maybe write some nice x86 assembler). Hopefully I'll never again have to use this horrible AppleScript language. |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.10 seconds |
|