« Twitter and responsibility || Embedded searches in Google »

Design & Programming, Mac, Software, Technology

How to get the dimensions of the dock with AppleScript in Mac OS X Leopard

26.05.08 | 5 Comments

This code snippet might be useful for anyone wanting to write a script to resize your application windows automatically to fit on your display.

Note: I’m fairly sure you need to enable UI scripting for this to work.

  1. tell application "System Events" to tell process "Dock"
    set dock_dimensions to size in list 1
    set dock_width to item 1 of dock_dimensions
    set dock_height to item 2 of dock_dimensions
    end tell

5 Comments

have your say

Add your comment below, or trackback from your own site. Subscribe to these comments.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

:

:


« Twitter and responsibility || Embedded searches in Google »