Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been using the Better Touch Tool and Right Zoom to be able to maximize windows to full screen, and to resize windows to the center, or top right / left quarter of the screen. Those apps are pretty slick.

What I really want is a way to predefine some windows specs and then apply that to a window. For example, the window could be 1024 * 768, or maybe it could be 300px from each edge of the screen.

I know the green button is supposed to choose a nice size for the window but it doesn't always work and with some apps (like TextMate) I'd just prefer to have a preset size / position that I could use.

I could probably somehow use applescript, but at times it seems to take forever before it runs so a native app for this would be cooler.


share|improve this question
If AppleScript takes too long you're probably wrapping it in a service. It's Automator's fault, not AppleScript. Use FastScripts or the global scripts menu you can enable via AppleScript Editor's preferences. – Daniel Beck Mar 29 '11 at 15:17
@db - off topic, but what if I save applescript as an app and then add it to the toolbar of finder windows? seems like sometimes this takes several seconds before running. – cwd Mar 29 '11 at 15:48
Haven't experienced that yet. How does it perform with the scripts menu I suggested, and placing them in /Users/cwd/Library/Scripts/? I'm not on a Mac right now. Btw, skip the @ or get it right -- I didn't get notified at about your comment. – Daniel Beck Mar 29 '11 at 15:57
I'll try using the scripts menu. regarding the @, I didn't realize it actually notified when using it. Where is the documentation on that? – cwd Mar 29 '11 at 16:05
The Applescript runtime can take up to a few seconds to load, which causes a delay if you haven't run any scripts in a while. I'd say it's usually under a second though. And How do comment @replies work? - Super User Meta. – user495470 Mar 29 '11 at 16:22
up vote 5 down vote accepted



Optimal Layout

AppleScripts for saving and restoring default dimensions

Save Bounds.scpt

    set text item delimiters to space
    tell application (path to frontmost application as text)
        set b to (bounds of window 1) as text
        set n to name
    end tell
    do shell script "a=" & quoted form of n & "
touch \"$f\"
sed -i '' \"/^$a: /d\" \"$f\"
echo \"$a: " & b & "\" >> \"$f\""
end try

Restore Bounds.scpt

    tell application (path to frontmost application as text)
        set n to name
        set s to do shell script "sed -En s/^" & quoted form of n & "': (.*)/\\1/p' ~/Notes/bounds.txt"
        set bounds of window 1 to words of s
    end tell
end try

AppleScript for resizing windows to specific dimensions

        tell application "Finder" to set {0, 0, dtw, dth} to bounds of window of desktop
        tell application (path to frontmost application as text) to tell window 1
            set b to bounds
            set w to (item 3 of b) - (item 1 of b)
            set h to (item 4 of b) - (item 2 of b)
            set b to {dtw - w, (dth - h) / 2, dtw, dth - (dth - h) / 2}
            set bounds to b
        end tell
end try
share|improve this answer
Divvy's on sale today by the way, $2 on the App Store. – Daniel Beck Jun 5 '12 at 17:52

Your Answer


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.