Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Hide file extension via rename Desktop
To hide the extension of a file:
  • Slow: Highlight file, press Command-I, check the Hide Extension box.
  • Fast: Remove the extension by renaming the file without the .xyz extension in the Finder.
[robg adds: I'm not sure how well documented this is, but I've used the same trick for quite a while, and I don't think we've run it here before. Removing the extension won't affect your ability to open the file via a double-click on the Mac, but it is destructive, whereas Hide is not. If you're going to move the file to a PC, you'll want to add the extension back on.]
    •    
  • Currently 1.86 / 5
  You rated: 2 / 5 (7 votes cast)
 
[18,403 views]  

Hide file extension via rename | 23 comments | Create New Account
Click here to return to the 'Hide file extension via rename' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Hide file extension via rename
Authored by: innate on Apr 05, '06 07:37:32AM

I don't think that removing the extension is desctructive. If you remove the extension in the finder, it will just turn on the "Hide Extension" flag for that file. The extension is still there (which you can see in Get Info).



[ Reply to This | # ]
Not for me
Authored by: jecwobble on Apr 06, '06 02:56:04PM

I have 10.3.9, so maybe that makes a difference, but I just got info on a TIFF file. It showed the full file name with extension and had a "hide extension" checkbox (unchecked). I closed the info window, removed the ".tif" extension in the Finder and got info again. This time the file name was displayed WITHOUT an extension and the "hide extension" checkbox was gone entirely.



[ Reply to This | # ]
Hide file extension via rename
Authored by: b00le on Apr 05, '06 07:45:19AM

It can indeed affect the Mac's ability to open a file. I recently wanted to remove the .jpg extensions from a couple of hundred digital camera files on a CD (to make contact sheets for a university thesis - long story). Renamer4Mac did the job just fine, but Photoshop would no longer recognise the files as something it could open. The only solution was to run a Batch process to open each file in Photoshop, then save it again - after that, removing the extensions did no harm (something to do with resource forks, or whatever they're called these days? Geek input required...)



[ Reply to This | # ]
Hide file extension via rename
Authored by: fracai on Apr 05, '06 08:33:01AM

I bet you could have selected all the images, selected Get Info for them all (Info Inspector is probably the best bet or you'll end up with a window for each if the number of files is low), and change the Open With selection to Photoshop.

Opening and saving with PS probably just set the type and creator info. It's possibly that the Open With data was also set in this manner.

---
i am jack's amusing sig file



[ Reply to This | # ]
Hide file extension via rename
Authored by: ngb on Apr 05, '06 10:22:30AM

Photoshop is very strict when it comes to dealing with filename extensions. Having the wrong extension is even worse than having no extension. I think the programmers were being lazy, because a peek at the first several bytes of data in an image file will usually reveal what type it is (jpeg, tiff, etc.)

If you need to make contact sheets without filename extensions (and without having to rename everything), you probably need to create a custom script using javascript, which is a pain because the built in contact sheet action is so nice.



[ Reply to This | # ]
Hide file extension via rename
Authored by: b00le on Apr 06, '06 07:03:58AM
Setting 'Open with...' to Photoshop: I thought of that - it didn't work. Opening, resaving with the 'Batch...' command, and then removing the extension, did.

[ Reply to This | # ]
not destructive
Authored by: dom on Apr 05, '06 09:55:05AM

the original post said "rename in the Finder", and by that it meant "not in the Get Info window". If you remove the extension in the Finder, it's still there, but hidden. Rob, maybe you could edit to clarify?

Completely different is if you remove it in the Get Info window, you're actually deleting it, of course, but the Finder will warn you first! You can't actually (destructively) delete an extension without the Finder giving you that annoying dialog box. Of course, if you use a third-party utility or the command-line you bypass the warnings, but you should know that already, no?



[ Reply to This | # ]
Hide file extension via rename
Authored by: bdog on Apr 05, '06 10:21:05AM

OK, I actually tested some of this stuff. Removing the extension (from the icon's name or in get info) DOES remove the extension. The only way to hide it is in an Info/Inspector window, or set it globally via Finder's advanced prefs.

Removing the extension CAN have an effect on how it opens on a Mac.

Dealing with multiple files, it's faster to get an inspector window, then hide the extension with one click, instead of renaming every file. Really, it's best practice to leave the extension alone. Why remove it if it can break things/change behaviou?



[ Reply to This | # ]
Hide file extension via rename
Authored by: beepotato on Apr 05, '06 10:37:58AM

> Removing the extension (from the icon's name or in get info) DOES remove the extension. The only way to hide it is in an Info/Inspector window

No. Removing the extension from the file displayed name (the icon's name) does NOT remove the extension from the real name, it just hides it (unless you checked "always show extensions" in the Finder preferences, in which case the Finder asks you for confirmation before removing the extension).

The only time renaming a file directly in the Finder actually removes its extension is when the extension is not known by the Finder as a valid extension. This happens when there is no application on the computer claiming that file type with that extension. Then the Finder doesn't consider the ".blahblah" as an extension but just as part of the file name, and it allows you to remove it.

But, again, when the extension corresponds to a known file type, the Finder won't let you remove it without first warning you.



[ Reply to This | # ]
Hide file extension via rename
Authored by: bdog on Apr 05, '06 03:06:08PM

Ahh yes, thank you for explaining it. I have show all extensions set. I never knew all this crazyness existed when you turn that pref off.



[ Reply to This | # ]
Hide file extension via rename
Authored by: innate on Apr 05, '06 10:41:06AM

That has not been my experience. I have a test file here, "test.png". I change its name to "test". In the Finder it no longer has an extension, but when I go into Get Info, the name is still "test.png" with the "Hide extension" box checked.

What file were you renaming? Perhaps the Finder behaves differently based on the file type.

By the way, I am using OS X 10.4.6. Maybe this behavior was different in an earlier OS.



[ Reply to This | # ]
Hide file extension via rename
Authored by: innate on Apr 05, '06 10:43:14AM

(I was replying to bdog, not bpotato. I think bpotato has got it right: the Finder will only let you delete the extension if it is not a known extension.)



[ Reply to This | # ]
Hide file extension via rename
Authored by: b00le on Apr 06, '06 07:11:18AM

Why do it? I can't think of a reason, except in the case I described above - to get a Photshop contact sheet without the extensions in the filename, where merely hiding them did not work. I believe if the files had been created with a Mac Photoshop in the first place, remving the extension would not have caused a problem.



[ Reply to This | # ]
Hide file extension via rename
Authored by: rspeed on Apr 05, '06 11:17:41AM

This is one of the reasons why I'm not sad to see Avie Tevanian leave Apple. This feature shouldn't be necessary in the first place.



[ Reply to This | # ]
Hide file extension via rename
Authored by: PopMcGee on Apr 05, '06 12:48:02PM

This only works if there isn't another known extension in the filename after your deletion (like ".pict", ".zip", whatever). If there is, the finder will expect that the new extension will be the extension you wished and ask for a confirmation, then proceed with deleting the old extension (that is, your old extension is not hidden, but effectively deleted).

And yes, Avie, your insistence on file extensions was a real dog. In this case, for once, we're glad you left Apple.



[ Reply to This | # ]
Hide file extension via rename
Authored by: osxpounder on Apr 05, '06 02:57:35PM

I like file extensions just fine. I like knowing at a glance what kind of file it is, and I like the fact that files I hand off to a PC [I must work with both] don't need any special attention from me.

---
--
osxpounder



[ Reply to This | # ]
Hide file extension via rename
Authored by: sjk on Apr 05, '06 05:28:24PM

Anyone know a way to tell Finder to automatically hide the .webloc extension on files created from URLs dragged from Safari's location field (and other places)? Is there some way to run "Hide extension" with Automator?



[ Reply to This | # ]
Hide file extension via rename
Authored by: b00le on Apr 06, '06 07:13:58AM

Finder Preferences / Advanced /



[ Reply to This | # ]
Hide file extension via rename
Authored by: sjk on Apr 06, '06 11:41:17AM
Finder Preferences / Advanced /
Nope. Give me some credit for already trying some that obvious (long ago). :-)

[ Reply to This | # ]
Hide file extension via rename
Authored by: sjk on Apr 06, '06 11:45:34AM
Uhh, something that obvious.

[ Reply to This | # ]
Hide file extension via rename
Authored by: beepotato on Apr 06, '06 03:11:10PM

If you usually drag them to the desktop, then you could attach a folder action to the desktop to automatically hide the extension of newly created webloc files.



[ Reply to This | # ]
This also works, perhaps better
Authored by: Mitchell on Apr 05, '06 06:11:07PM
At least it's non-destructive and maintains platform cross-compatibility With the Developer Tools installed, run
SetFile -a E fileName.ext
and that should take care of it. I use this often enough that I have an alias, called "moyel," in my .cshrc.

[ Reply to This | # ]
This also works, perhaps better
Authored by: sjk on Apr 06, '06 02:16:10PM

Sweet. That's all I need to quickly hide those pesky .webloc extensions. Thanks!



[ Reply to This | # ]