user4150758
user4150758

Reputation: 453

Hide all apps using applescript

I am trying to work on an applescript to hide all apps that are open.

tell application "System Events"
    set visible of every process whose visible is true and name is not "Finder" to false
end tell

Unfortunately it is not working as expected.

My goal is as soon as applescript runs, hide all apps that are running

Upvotes: 1

Views: 1076

Answers (1)

Chino22
Chino22

Reputation: 165

according to Willeke, this works for me :

tell application "System Events"
    set visibleApps to every process whose visible is true and name is not "Finder"
    repeat with theApp in visibleApps
        set visible of theApp to false
    end repeat
end tell

Upvotes: 1

Related Questions