Networking | Hardware | Software | Multimedia | System | Unix&Linux | MBA

Home>>Unix&Linux>>Applescript: Hide Process

Applescript: Hide Process

Carl V
05-11-2005, 09:05 PM
This is a fairly basic question, and I'm not sure where it should go.

How can I hide a window, such as when pressing Apple+H, in Applescript? I used to be able to do it, but I cannot remember how to do so anymore!

robJ
05-11-2005, 09:49 PM
Does this work?

tell application "System Events" to ?br /> set visible of first application process ?br /> whose frontmost is true to false
-- Rob

Carl V
05-11-2005, 10:41 PM
Does this work?

tell application "System Events" to ?br /> set visible of first application process ?br /> whose frontmost is true to false
-- Rob

Just what I wanted!

tell application "System Events" to set visible of process "Safari" to false

robot_guy
05-11-2005, 10:52 PM
An alternate approach, depending on what you're trying to do, would be to make all of an app's windows invisible; unlike with command-H, they'll stay invisible until your script tells them to become visible.

This script toggles visibility on and off for Safari windows. Note that the app itself is not hidden: you can still create new, visible windows while the existing ones are invisible.

In some applications (notably the Finder), open windows cannot be made invisible, but the script works with the other apps I tested (Safari, Mail, and iChat).

property notHidden : true

on run
if notHidden then
tell application "Safari" to set visible of every window to false
set notHidden to false
else
tell application "Safari" to set visible of every window to true
set notHidden to true
end if
end run

Carl V
05-11-2005, 11:09 PM
Thanks for the tip.

I have a backup program run every night at 6 automatically (to a server), and I was getting sick of the window popping up every night. A little applescript can go a long ways.

Paul Courtade
05-15-2005, 05:14 AM
I have used "Drop Script Backgrounder" to hide the running of any AppleScript.
When applied to an Applescript.app it keeps any Applescript.app running in the background. I believe it is freeware.

http://www.sentman.com/backgrounder/


 

TOP

Windows Server Outsell
Unix Signals And C++ E

For more info

Unix Signals And C++ E
Windows Server Outsell
ssh setup for password
Bash script does not w
esc code 
ARD send unix command 
question about binarie
Scanning mail 
Issuing multiple comma
How do I install Linux

News Archive

/etc/hosts? 
Manually Start a Start
mounting missed hard d
Using Netinfo in Singl
darwin/bsd login probl
system_profiler and fi
Send mail from script 
mounting a drive 
OS X disk first aid ha
system.log shows steal

Related stories:

How to set environment variables and path in 10.4?
problem installing Fink
pkg-config & PKG_CONFIG_PATH
help with installing py-gnome (darwinports)
Mozilla install from dports fails
ssh - don't want to use password
Escaping quotes in Tiger

Copyright@2004-2005 www.zzcoke.com All Right Reserved

advanced web statistics