Hiding an application?

I went looking around the internet for many questions and found answers to all of them except: How to hide an application ( Like when you select “hide ” from the Applications menu )
I tried telling the finder to set the visible of a process named “<application name” to false and that worked sometimes but not all the time. I was wondering if there was a set command to do this.
Thanks,
–Chris

This is from the AS Finder Guide:
The following script hides the TeachText application process:

tell application "Finder"
set visible of application process "TeachText" to false
end tell

End Finder Guide excerpt.
Note the word “application” before process. Seems to work better than just process (as per my experience, not necessarily from something I read). You may need to use in conjunction with “every process” or “frontmost” to get the name of the application first. Another option would be to use the Application Menu Addition (though I haven’t needed it yet, since the scriptable Finder has ‘always’ come through on this command).

Well, this is what I did:
I activated a program ( the appearance control because I was making myself a desktop picture changer to get used to AppleScripting ) and then I would try to hide it. It worked sometimes when i set a delay between activation and hiding greater than 4 seconds, and no I didn’t activate the finder.
The Application Menu Addition works perfectly though, thanks :slight_smile:
–Chris

Hmmm…that still seems to only work sporatically. Where can I find the commands for the Application Menu Addition, I can try that out.
Thanks for the advice though.
–Chris

Go to Scripting Additions and download the Application Menu Addition and look into its AS dictionary for the commands. You can find process commands in other additions too. Akua Sweets has a few options.
How are you using the Finder command when it is being ‘sporadic’? Likewise, when does it preform solidly in your script? Are you trying to use the command without activating the Finder? Within nested tell blocks or a handler? Finder command works solidly for me where I’ve applied it, so I’d like to know where it preforms poorly, if indeed it does. Please post more specifics.