With windows you can use the function findwindow() in user32.dll to find running windows. Is there a way to do that with a mac? I want to use java to find the running terminal window and when I click buttons on my java gui I want certain commands to be inserted to the terminal. How can I make this happen?