How to set an application to be open in max window size? I want to set that by default an application I open (specifically Preview) will be opened in maximum window size.
Note that I do not want it to be in full screen. I want the window to take the maximum size - leaving room for the top-bar and the dock.
As Preview (and or macOS) does not have a preference setting that always opens windows of an application in full desktop (not to be confused with full screen), here is an alternate answer that provides for a keyboard shortcut in Preview to resize the frontmost window in Preview.
This uses no third-party anything and can be done using macOS default applications and some AppleScript code without having to mess with System Integrity Protection.
Create an Automator Service/Quick Action with settings as shown in the image further below.
Add a Run AppleScript action replacing the default code with the following example AppleScript code:
tell application &quot;Finder&quot; to ¬
    set {missing value, missing value, ¬
        desktopWidth, desktopHeight} to ¬
        the bounds of window of desktop

tell application &quot;System Events&quot; to ¬
    tell application process &quot;Finder&quot; to ¬
        set {missing value, menubarHeight} to ¬
            the size of menu bar 1

tell application &quot;System Events&quot; to ¬
    tell application process &quot;Dock&quot; to ¬
        set {missing value, dockHeight} to ¬
            the size of list 1

tell application &quot;Preview&quot; to ¬
    if (exists front window) then ¬
        set bounds of front window to ¬
            {0, menubarHeight + 1, desktopWidth, ¬
                desktopHeight - dockHeight}

Assign it a keyboard shortcut in: System Preferences &gt; Keyboard &gt; Shortcuts &gt; Services
I used ⌥⌘F as it is not currently assigned in Preview.

Testing in macOS Catalina, the first time I used it I had to click the OK button on the message box shown below.




Notes:
The example AppleScript code shown above assumes the Dock is always visible and additional coding is required if the Dock is hidden.
If you are one that likes to have the Dock hidden, then use the following example AppleScript code instead of the previous example AppleScript code:
tell application &quot;Finder&quot; to ¬
    set {missing value, missing value, ¬
        desktopWidth, desktopHeight} to ¬
        the bounds of window of desktop

tell application &quot;System Events&quot; to ¬
    tell application process &quot;Finder&quot; to ¬
        set {missing value, menubarHeight} to ¬
            the size of menu bar 1

tell application &quot;System Events&quot; to ¬
    tell application process &quot;Dock&quot; to ¬
        set {missing value, dockHeight} to ¬
            the size of list 1

tell application &quot;System Events&quot; to ¬
    set dockIsHidden to ¬
        autohide of dock preferences

if dockIsHidden then
    set windowHeigth to desktopHeight
else
    set windowHeigth to desktopHeight - dockHeight
end if

tell application &quot;Preview&quot; to ¬
    if (exists front window) then ¬
        set bounds of front window to ¬
            {0, menubarHeight + 1, ¬
                desktopWidth, windowHeigth}


If by chance you want this to act on all windows in Preview then change the tell application &quot;Preview&quot; command as the last command in the code to the following example AppleScript code:
tell application &quot;Preview&quot; to ¬
    if (exists windows) then ¬
        set bounds of windows to ¬
            {0, menubarHeight + 1, ¬
                desktopWidth, windowHeigth}