I can hide all visible application with the keyboard shortcut: command + h
Is is possible to create an Applescript to make all hidden applications visible again?
I can hide all visible application with the keyboard shortcut: command + h
Is is possible to create an Applescript to make all hidden applications visible again?
Try this:
-- Show all applications
tell application "Finder"
activate
set visible of every process whose visible is false to true
end tell
Hi,
this is quite difficult, because there are a few apps which should be hidden permanently.
So simply setting the visible property of all processes to true is not to be recommended.
This script compares the currently hidden apps with all present apps in the dock (parsing the plist file),
because the “real” hidden daemons and agents don’t appear in the dock, filters the valid apps
and sets their visible property
set pListpath to ((path to preferences folder as Unicode text) & "com.apple.dock.plist")
tell application "System Events"
tell property list file pListpath
set dockFiles to {}
repeat with i in property list items of property list item 1 of contents
try
set end of dockFiles to value of property list item 2 of property list item 1 of i
end try
end repeat
end tell
repeat with i in (get name of processes whose visible is false)
if contents of i is in dockFiles then set visible of process i to true
end repeat
end tell
Hello elliotlarson and StefanK,
As much as I hate to differ with Stefan, all of that code is not necessary. If you change my script to:
tell application "Finder"
activate
set visible of every process whose visible is false to true
return (get name of every process whose visible = false)
end tell
you will see that only Finder applications are affected. This is what my results were after running the above script:
{“lsd”, “loginwindow”, “WacomTabletDriver”, “IntegoStatusItemHelper”, “Little Snitch UIAgent”, “Dock”, “TabletDriver”, “SystemUIServer”, “GrowlHelperApp”, “SpeechSynthesisServer”, “iCalAlarmScheduler”, “UniversalAccess”, “Quicksilver”, “iTunesHelper”, “ExpanderDaemon”, “Aion”, “TemperaturMonitorLite”, “RapidoWriteService”, “Ejector”, “Alarm Clock”, “Jumpcut”, “Jing”, “Meteorologist”, “System Events”, “RapidoStart”, “HPEventHandler”, “HP Scheduler”, “TechToolProtection”, “RSS Menu”}
Cheers,
Tony
Hi Tony,
you’re absolutely right, my “extended version” is not necessary.
After reading again the dictionary of “System Events”, I found another simple way
tell application "System Events" to set visible of (processes whose background only is false and visible is false) to true
It’s not clear why the “and visible is false” filter is necessary. System Events has to visit every non-background app anyway, so just set them all to true no matter what they were. Same effect.
Wow, thanks for all the help!
Tony, I gave your solution a quick try last night and it did the trick in short order. Thanks.
Stefan, I love the idea of parsing the dock’s plist file. While not the best solution here, that was a creative approach. I haven’t tried your follow-up approach yet, but it looks like a compelling one-liner. Thanks for the input.
Adam, thanks for lending your noodle to the improvement machine.
Cheers,
Elliot