Developer's Blog

Feel at ease by automatically hiding file extensions. Let’s try out Mac OS folder actions

I usually hide all file extensions because I can tell what kind of files I am looking at by the icon, and I don’t feel at ease when looking at the unnecessary extensions at the end of file names.(Other people may be different)

However, there are some applications that do not hide extensions when saving, which can be a real pain to manually hide afterwards.

Extensions feel like codes that are not user friendly, and just unnecessary information.

So if you feel the same way, please use automization with folder actions.
Folder actions is a system for automatically executing scripts in Mac OS when files are placed in folders.

I have written a simple AppleScript below.

on adding folder items to thisFolder after receiving addedItems
 return hideExtensions(addedItems) of me
end adding folder items to

on hideExtensions(theseItems)
 tell application "Finder"
  repeat with thisItem in theseItems
   set extension hidden of thisItem to true
  end repeat
  return theseItems
 end tell
end hideExtensions

Save this script in the [Script editor] and insert it into

~/Library/Scripts/Folder Action Scripts/

Because Library is hidden in OS X Lion, please open it using Finder from Menu [Go] while pressing option.
If there is already no Scripts folder or Folder Action Scripts folder, please create a new folder.

Attach the script to the folder.

Folder actions can be set by associating scripts to folders. Firstly, right-click on the folder you want to attach a script to while holding control, and then select [Folder action settings…].
Afterwards, all you have to do is choose the scrip you want to associate. When doing this, if there is no check in [Use folder action], please turn it on.

Ok, so let us try attaching the previous script to the desktop.

You can select the script in the Folder Action Scripts folder.

This will make any files that are added to the desktop not display extensions of files.
Folder actions themselves are a little slow to execute. You will find they work as soon as you realize.

File names look a lot neater.

In addition to this function, with folder actions you can copy files to another location if they have been inserted in a specific folder, create dated folders and automatically sort files in them, and much more.
Try automating all those small burdensome tasks!

Please freely use the AppleScript mentioned in this article at your own risk.
This operation has been checked for the latest versions of OS X Lion and Mac OS X Snow Leopard at the time of writing this article.

Please join us on Facebook for Sleipnir for Mac!

Please follow us on Twitter!

Facebook Comments