Access a non-scriptable application window using Finder or Events?

Let me start off with the normal newbie statement “I am pretty new to applescript but…”

I have been working on an application that will list every visible window, the main goal is to have a “task” bar running, that I can simply see every single document window and application window in a single place. So I do not have to right click on the dock to see the accessible windows…

So I have a script that will now list every document window. And it actually works… however when I try to get properties or modify properties, it doesnt work.

My question is, is it possible to access a non-scriptable application window using either the finder, or system events?

Here is the code that I have so far. Basically it loops through all running processes, and then loops through each of the windows for that process.


tell application "System Events"
	
	set appList to every process whose visible is true
	
	repeat with thisapp in every item in appList
		
		set appWindowList to every window in thisapp
		
		repeat with win in appWindowList
			
			set winname to get name of 1st item of win
			set appname to get name of 1st item of thisapp
			
			try
				display dialog (appname & ": " & winname)
			end try
			
		end repeat
		
	end repeat
	
end tell

Now this all works fine and dandy, however, when I try to do anything with said windows, it chokes. Like setting winname to front, or to minimize or maximize…
Any suggestions?

Thanks
Brandon Corbin

This is almost assuredly not going to work. The problem is that there is no definitive way to implement AppleScript so even if an application is scriptable, there is no uniform way to address each application–you’ll most likely need custom code for each and every app, if it even supports AS at all. Sorry.

Jon