Toggling Hidden File Visibility with Applescript

I wrote a quick little applescript today that allows one to show or hide hidden files on demand, since this doesn’t seem to be an option in Finder. ¬†Applescript is a terribly designed language, but it does allow you to easily get crap done in OSX. ¬†I have it in github here, and it’s so concise, I figured I’d just paste the current version here:

set Status to do shell script "defaults read com.apple.finder AppleShowAllFiles"
if Status = "OFF" then
	do shell script "defaults write com.apple.finder AppleShowAllFiles ON"
else
	do shell script "defaults write com.apple.finder AppleShowAllFiles OFF"
end if
do shell script "killall Finder"

Just download it, open it in the Script Editor (I can double click it), and do Save As. Then, select Application as the type, and do Run Only and save it. Then, hide it away and make an alias to it, and drop that on the desktop. Here’s what mine looks like:

And after I double click that Alias:

I like this – it makes basing things on system configuration really easy.


One thought on “Toggling Hidden File Visibility with Applescript

Leave a Reply

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