Get window size from process ID instead of process name?

Hi,

I usually use code similar to this to get the size of a window:

set currentSize to {}
tell application "System Events" to tell application process "Skype" to set currentSize to size of window 1

Instead of window 1 I will sometimes specify a window by name. I currently have a unique situation where I am running “wine” applications so instead of a process name I have multiple instances of “wine”, I have no problem getting the process ID but I do not know how to implement that correctly in applescript.

set currentSize to {}
set processID to 11443
tell application "System Events" to tell processID to set currentSize to size of window 1

I understand the above code is incorrect but I put it there so you can see what I am trying to achieve, what is the correct implementation of trying to get applescript to use process ID instead of process name?

Thanks!

After playing around I managed to get this working , hope it helps somebody.

tell application "System Events"
	set currentSize to {}
	set processID to 13111
	tell 1st item of (processes whose unix id = processID) to set currentSize to size of window 1
end tell
1 Like