How can I get the width or height of the dock in Mac OS X so I can resize a window properly? I want to write a code to resize a window by setting its bounds, and I need to consider where the dock is positioned and the size of the dock. I can get the dock's position and its size, but the problem is the size I'm getting is not in an immediately usable form. For example, when I do:
tell application &quot;System Events&quot;
    tell dock preferences
        properties
    end tell
end tell

I get
{show indicators:true, minimize into application:false, autohide:false, magnification size:1.0, class:dock preferences object, dock size:0.428571432829, autohide menu bar:false, double click behavior:zoom, magnification:false, show recents:true, minimize effect:genie, screen edge:left, animate:true}

How do I translate the dock size of 0.428571432829 into, for example, 100 so that I can set a window (in a 1024x768 resolution) to position x=100, y=0, h=768, w=924?
Notice x started after the dock, and the w is minus the dock width.
The following example AppleScript code will return the size of the Dock:
tell application &quot;System Events&quot; to ¬
    tell application process &quot;Dock&quot; to ¬
        set dockSize to ¬
            the size of list 1

return dockSize

If you want the width and height:
tell application &quot;System Events&quot; to ¬
    tell application process &quot;Dock&quot; to ¬
        set {dockWidth, dockHeight} to ¬
            the size of list 1


return {dockWidth, dockHeight}