How to quickly hide files from your Mac desktop




Automator: How to quickly hide files from your Mac desktop
Many users have no idea what extensive features such a powerful tool as Automator provides. At first glance, the program is quite difficult to learn, but once you understand it, you can see that the control is quite intuitive and intuitive. Today we will tell how using a simple service, you can put macOS desktop in order, hiding all the files.

Many users actively use the desktop when working with files, as a result of which it quickly loses its original appearance. Despite the fact that the macos Mojave option appeared “Stacks”, which sorts documents into folders, this is only a partial solution to the problem. Today we will explain how using Automator to create a service that will allow you to visually clean the desktop, while not deleting the files themselves.

So what is needed for this?
First of all we start the Automator application. In the window that opens, select the “New Document”.

When launching, the program will offer us a choice of several scenarios for further work. Choose “Quick Action”.
After creation in the right window we find “Process gets in”. Specify in the drop-down list “Finder”.

In the left part of the program, you need to use the search and find the item “Launch AppleScript”. We overtighten in working area.

Now in the script window you need to copy and paste the following code:
on run
tell application “System Events”
set _activeApp to name firstmost is truemost
end tell
set _theVar to ((do shell script “defaults read CreateDesktop”) as integer) as boolean
on error – if it doesn’t exist, create it …
do shell script “defaults write CreateDesktop 1”
set _theVar to ((do shell script “defaults read CreateDesktop”) as integer) as boolean
end try
do shell script “defaults write CreateDesktop” & (((not _theVar) as integer) as string)
tell application “Finder” to quit
delay 1
tell application “Finder” to launch
tell application _activeApp to activate
end run

Save the service: “File” -> “Save”. Specify the name of the service (any, but it is desirable to save as “Hide files from the desktop” for greater convenience).
All the necessary actions we carried out, Automator can be closed. The next step is to check our service. To do this, on the desktop, select “Finder” -> “Services” -> “Hide files from the desktop.”

We will request the appropriate permission. We agree. After this, all files should disappear from the desktop. To return them, it is enough to activate our service again.


In: A Technology & Gadgets Asked By: [23225 Red Star Level]

Answer this Question

You must be Logged In to post an Answer.

Not a member yet? Sign Up Now »