activate expose "application windows"

Hi,

I am trying to accomplish bringing up exposés “application windows”-- this is to try to solve an issue im dealing with reagrding X11 and xterm… I found that when X11 has been set to run invisibly (no icon on dock), the windows that it generates are not really there-- so you can’t access them…

I discovered though through my applescript that launches a new xterm window, when this app is active in the front, if I execute exposé’s “application windows”, it comes to the front and then I can hit return to select it… A perfect solution… So I did this:

on reopen
	set myCommand to POSIX path of ((path to me as string) & "Contents:Resources:xtermlauncher")
	do shell script ((quoted form of myCommand) & " > /dev/null 2>&1 &")
		tell application "System Events" to keystroke (key code 103)
		tell application "System Events" to keystroke return
end reopen

However, all this does is beep at me because it doesn’t believe a window is there-- I also think its due to the fact that System Events is hitting F11, rather than me hitting F11 while this app is active and in the front…

So I am wondering, is there a way to activate expose without the use of keystrokes? If not, is there a way to ensure that if you do a keystroke that it is coming from a specific application? Is this a hopeless endeavor?

Thanks in advance as always.