Change default Preview window size

pdfpreviewterminal

I'm working with LaTex and I'm using a text editor that, when I compile LaTeX files, runs a script to open the compiled pdf in Preview. The trouble is that Preview opens in the same default dimensions every time, which covers up other applications I have open.

It's not a huge deal, but it would be nice to have Preview open flushed right and as half the width of the screen every time. Since I'm opening and closing it so often, moving it and resizing it every time gets really annoying.

I realize this isn't a built-in option for Preview, but is there any way of doing it using Terminal or otherwise? I've googled around and haven't found any satisfactory answers yet.

Best Answer

You might want to check out this question: What window management options exist for OS X?

My recommendation, if you want it to be fully automatic, is to use Slate.

Slate is no longer in active development, but it still works and is highly customizable. Put this code in a .slate.js file in your home directory:

var rightHalf = slate.operation("move", {
   "x" : "screenSizeX/2+screenOriginX",
   "y" : "screenOriginY",
   "width" : "screenSizeX/2",
   "height" : "screenSizeY"
});
slate.on("windowOpened", function(event, win) {
    if (win.app().name() === "Preview") {
        win.doOperation(rightHalf);
    }
});