I tried to use the following AppleScript
to get the PID
s of all the windows (including ones that are minimized). This script doesn't get the PID
s of windows on other desktops.
Is there any workaround for this so I can still get a list of opened windows across all desktops without having to activate
individual processes and checking if they have windows?
tell application "System Events"
repeat with proc in (every process)
if exists(first window of proc) then
set pid to unix id of proc
log pid
end if
end repeat
end tell
PS, I'm not too proficient with AppleScript. I've managed to hack this together using StackOverflow. This might not be the most efficient way to do what I'm trying to do.