Hi there!
I've written a simple AppleScript droplet for hiding file extensions on multiple items (see below). However, I've got a couple of oddities.
Firstly, if I drop a folder onto the droplet, then the folder is copied, with the new copy having had all the extensions hidden. While the resulting folder is exactly what I wanted, I'm really rather hoping to edit the existing files, as if I did this to, say, a folder full of movies, then it would take a huge amount of time just to hide some file extensions! If it's relevant, I've added the droplet onto the toolbar in the Finder so I can easily drop items onto it.
Secondly, if I drop a very large number of files onto the droplet by selecting the files (rather than the enclosing folder) then the droplet seems to just crash. In a recent example I dropped 500+ images onto it, but it seemed only hide the extension of a single file before becoming completely unresponsive; while I can understand it taking a long time, I can't see why it would fail entirely, but I've left it running for well five minutes with nothing happening. For less than 100 items it just flies through and runs seemingly instantaneously.
Anyway, here's the AppleScript I've written; I've seen more complex ones out there that process the folders into a massive list of files before processing that, but I thought that this was much simpler, and seemed to work just as effectively (the more complex scripts have the same basic problems).
P.S - couldn't find out if there's a way to format code tags for AppleScript?
I've written a simple AppleScript droplet for hiding file extensions on multiple items (see below). However, I've got a couple of oddities.
Firstly, if I drop a folder onto the droplet, then the folder is copied, with the new copy having had all the extensions hidden. While the resulting folder is exactly what I wanted, I'm really rather hoping to edit the existing files, as if I did this to, say, a folder full of movies, then it would take a huge amount of time just to hide some file extensions! If it's relevant, I've added the droplet onto the toolbar in the Finder so I can easily drop items onto it.
Secondly, if I drop a very large number of files onto the droplet by selecting the files (rather than the enclosing folder) then the droplet seems to just crash. In a recent example I dropped 500+ images onto it, but it seemed only hide the extension of a single file before becoming completely unresponsive; while I can understand it taking a long time, I can't see why it would fail entirely, but I've left it running for well five minutes with nothing happening. For less than 100 items it just flies through and runs seemingly instantaneously.
Anyway, here's the AppleScript I've written; I've seen more complex ones out there that process the folders into a massive list of files before processing that, but I thought that this was much simpler, and seemed to work just as effectively (the more complex scripts have the same basic problems).
Code:
on open (ItemList)
tell application "Finder"
repeat with thisItem in ItemList
if kind of thisItem is "folder" then
set extension hidden of every file of entire contents of (thisItem as alias) to true
else
set extension hidden of thisItem to true
end if
end repeat
end tell
end open
P.S - couldn't find out if there's a way to format code tags for AppleScript?