Hiding document of 1-2 apps EXCEPT for their 1st window

Hi and good day,

There is the script out in the space to hide all docs & apps (almost):

//
tell application “System Events” to set visible of every application process to false
//

but if I want to leave the one I’m working on active and hide the rest?

so: leave 1st window visible?

I could move TextEdit/ Tex-Edit Plus to its dedicated TotalSpace, then there will be only those text documents.


Then I want to do the same with another app, such as Pages or Espresso (if they accept the same AppleScript commands).


So in the end in my dedicated TotalSpace, there would be visible only 1 window from TextEdit/ Tex-Edit Plus and 1 window from Pages or Espresso.

How could this be done?

/
with best regards,
Omar KN
Stockholm, Sweden

Hi,

any Cocoa application responds to the keystroke ⌥⌘H to hide all other applications


tell application "System Events"
	tell (first process whose frontmost is true) to keystroke "h" using {command down, option down}
end tell

Hallo Stefan,

This script hides all documents, but there is window 1 ( of several TextEdit documents) which should stay visible :slight_smile:

How can one hide all documents except for the one on top?

/
with best regards,
Omar KN
Stockholm, Sweden

The hiding function as well as the visible property of processes works all or nothing.
To “hide” single documents you have to minimize them (put them into the dock).

Alright -this time we go for “all or nothing!”

Thank you anyway!,

/
with best regards,
Omar KN
Stockholm, Sweden