Hide command and Activating buttons

I am needing to know if there is a command to tell Terminal to hide, as well i have a program that has a button that i want pushed. Is there a command to push that button?

To hide Terminal:

tell application "System Events"
	try
		set visible of process "Terminal" to false
	end try
end tell

It depends on the situation and the software that you have installed or are willing to install. More details are needed.

– Rob

I tried it but it didn’t work. I also tried,
set visible of application “Terminal” to false
but that didn’t work either.

The script that I provided works for me on OS X 10.2.6. Maybe I don’t understand what you want? Do you want to quit Terminal? Allow it to run but not see its windows? Define “tell Terminal to hide”. :slight_smile:

This should do it…

I’m not sure what the protocol is, but the “Finder” will perform the same task (it may be dependent upon which version of AppleScript & System Events you are using. I have AppleScript 2.0b v.20 with System Events 1.2) – e.g.,

Simplified to…

Again “System Events” can be replaced with “Finder” in either script. To ‘push’ a “Button” you’ll need to use Apples GUI Scripting options or use a third party addition such as Extra Suites.

As a side note; it’s not really necessary to hide the “Terminal.app” you can pass commands to the shell using two methods.

 do shell script "your_command"

This will execute your command to the shell without having to open a new terminal session.

tell application "Terminal.app"
activate
    do script "your_command;another_command" --semicolons seperate commands
end tell

This will open a new Terminal.app window and execute your command.

Thanks for the help, there’s only one thing left. When I open a program called Vendetta, it opens up a updater window. It checks if Vendetta is updated and then the “Play Vendetta” button lights up (is not greyed out anymore). I need a script that will wait till that button lights up and then activates it (clicks it).