Jump to content

Clean Up Icons


Recommended Posts

Invoking the hotkey for this workflow cleans up the icons of the currently open Finder window or the desktop (if it has focus). It was a mission and a half getting all the weird edge cases sorted out because the desktop itself (as opposed to a Finder window of ~/Desktop) is not directly scriptable. If anyone can think of a way of neatening up my code I'd love to see it :-)
 

Clean%20up%20icons%20-%20Screenshot.png

 

Download: Clean Up Icons

Edited by Subject22
Link to comment
  • 1 month later...
  • 2 years later...

Hi!

 

This applescript will get it done. This will work for any menu shortcut available in finder. Just add a hotkey or a keyword trigger in Alfred. I prefer keywords as i think they are easier to remmeber then hotkey. I use a similiar script to activate the menu in Sanedesk to switch virtual desk, but the icons always get scrambled, so i just type "clean" to activate the script below.

 

on alfred_script(q)
activate application "Finder"
tell application "System events"
    keystroke "1" using {option down, command down}
end tell
end alfred_script
Link to comment

UPDATE:

 

Added a row to automatically switch back to the application that was active when you envoked the script (wich puts foucs on the desktop). This means no windows will disapear, but instead there will be a slight flicker.

 

on alfred_script(q)
activate application "Finder"
tell application "System events"
keystroke "1" using {option down, command down}
keystroke tab using {command down}
end tell
end alfred_script
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...