Menu

Automator: How to hide files from the desktop Mac

12.01.2019 - Apple, Apps for macOS, iMac, MacBook, macOS
Automator: How to hide files from the desktop Mac

Many users do not realize what a vast possibilities provides such a powerful tool like Automator. At first glance, the program is quite complex to learn, but understand, you can see that the control is pretty intuitive and clear. Today we’ll show you how to use a simple service, it can cause desktop macOS in order, hiding all the files.

 

Many users when working with files actively engages Desk, causing it to quickly lose its original appearance. Despite the fact that in macOS Mojave there is an option “Stack”, which sorts the documents by folder, this is only a partial solution to the problem. Today we’ll show you how to use Automator to create a service that will allow you to visually clear the Desk, while not removing the files themselves.

So, what do you need?

 

 

 

on the run
tell application “System Events”
_activeApp set to the name of the first process whose frontmost is true
end tell
try
_theVar set to ((do shell script “defaults read com.apple.finder CreateDesktop”) as integer) as boolean
on error if the default value doesn’t already exist, create it…
do shell script “defaults write com.apple.finder CreateDesktop 1”
_theVar set to ((do shell script “defaults read com.apple.finder CreateDesktop”) as integer) as boolean
end try
do shell script “defaults write com.apple.finder CreateDesktop ” & (((not _theVar) as integer) as string)
tell application “Finder” to quit
delay 1
tell application “Finder” to launch
_activeApp tell application to activate
end run

 

All the necessary actions we performed, Automator can be closed. The next step is to test our service. On the desktop select “Finder” -> “Services” -> “Hide files from your desktop”.

 

We will request the appropriate permission. Agree. After this all the files should disappear from the desktop. To return them, you need to re-activate our service.

Leave a Reply

Your email address will not be published. Required fields are marked *