Listado de todas las ventanas de todas las aplicaciones.

Estoy tratando de escribir un script de AppleScript que cambia el tamaño de todas las ventanas abiertas. Para asegurarme de que estoy llegando a todas las ventanas, estoy haciendo que mi script diga el nombre de la aplicación, así como el número de ventanas abiertas de esa aplicación.
Curiosamente, mientras escucho los nombres de todas mis aplicaciones abiertas, mi script dice que todas tienen 0 ventanas abiertas. ¿Cómo puedo solucionar este problema?

Aquí está mi código:

tell application "System Events"
    repeat with theProcess in (every process)
        if background only of theProcess is false then
            if name of theProcess is not "Finder" then
                if name of theProcess is "Google Chrome" then
                    say "Chrome woo hoo"
                    say (count windows as string)
                else
                    say name of theProcess as string
                    say (count windows as string)
                    tell theProcess
                        repeat with theWindow in windows
                            say "found a window of"
                            say (name of theProcess) as string
                            tell theWindow
                                click button 2
                            end tell
                        end repeat
                    end tell
                end if
            end if
        end if
    end repeat
end tell

Estoy en Mac OS X 10.7.5, usando automator 2.2.4 para escribir / ejecutar este applecript

Respuestas a la pregunta(2)

Su respuesta a la pregunta