I'm using the following simple script:
tell application "System Events" to get the title of every window of every process
Which works by printing titles of every window (the same with position). Is there any similar way of printing process id (to which it belongs) of each window, using AppleScript?