Hiding File Extensions

Discussion in 'macOS' started by nope7308, Dec 18, 2008.

  1. nope7308 macrumors 65816

    nope7308

    Joined:
    Oct 6, 2008
    Location:
    Ontario, Canada
    #1
    How do you configure Leopard so it automatically hides all file extensions?

    I've gone to Finder/Preference/Advanced and unchecked the 'show all file extensions' option, but it does nothing. To remove the file extensions, I literally have to go into each individual file. There has to be some way around this, but I'm new to OS X and thus a complete noob.

    As far as I can tell, extensions are showing for most (if not all) file types (e.g. avi, pdf, rtf, doc, docx, etc.). I tried searching for an answer, but with no luck. Any help is greatly appreciated!
     
  2. dukebound85 macrumors P6

    dukebound85

    Joined:
    Jul 17, 2005
    Location:
    5045 feet above sea level
  3. jmxp69 macrumors 6502

    Joined:
    Dec 10, 2008
    #3
    In Terminal:

    Show Hidden:
    defaults write com.apple.finder AppleShowAllFiles TRUE && killall Finder

    Hide Hidden:
    defaults write com.apple.finder AppleShowAllFiles FALSE && killall Finder
     
  4. nope7308 thread starter macrumors 65816

    nope7308

    Joined:
    Oct 6, 2008
    Location:
    Ontario, Canada
    #4
    Didn't work... any other suggestions?
     
  5. jmxp69 macrumors 6502

    Joined:
    Dec 10, 2008
    #5
    Doh. I saw "hide" and immediately thought you were trying to show/hide hidden files, not extensions. Sorry--wrong command.

    Finder doesn't hide all of my extensions either, but it did hide .rtf.

    J
     
  6. nope7308 thread starter macrumors 65816

    nope7308

    Joined:
    Oct 6, 2008
    Location:
    Ontario, Canada
    #6
    OK, but why does Leopard hide .rtf extensions on your machine, but not mine? This is becoming a royal pain in the ass. I don't see the reason for hiding only some file extensions, but not all. What is so important about seeing .avi anyway?

    There has to be some way around this...
     
  7. jmxp69 macrumors 6502

    Joined:
    Dec 10, 2008
    #7
    I'll watch this thread for an answer. I don't have it.

    :)
     
  8. nope7308 thread starter macrumors 65816

    nope7308

    Joined:
    Oct 6, 2008
    Location:
    Ontario, Canada
    #8
    That makes two of us... I do appreciate your help, though! :)
     
  9. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #9
    It looks like Mac OS X just plain doesn't support this, unlike Windows. I did a Google search on this topic, and came up completely blank.
     
  10. nope7308 thread starter macrumors 65816

    nope7308

    Joined:
    Oct 6, 2008
    Location:
    Ontario, Canada
    #10
    I did the same... I guess windows is superior in some respects after all :eek:
     
  11. ChrisA macrumors G4

    Joined:
    Jan 5, 2006
    Location:
    Redondo Beach, California
    #11
    The concept of a "file extension" is a Windows/DOS thing that was never really use with UNIX. Yes many user level programs would applend letters on the end of a filename but as rar as the Unix files system goes "." (dot) is just another character and files names like this are perfectly OK "this.is.a.valid.file.name" Finder does not care much that a filename has a "dot" in it. It treats the dot just like it would an under bar.
    This has a long history in Unix that goes back long before there was a Company called "Microsoft".
     
  12. TuffLuffJimmy macrumors G3

    TuffLuffJimmy

    Joined:
    Apr 6, 2007
    Location:
    Portland, OR
    #12
    Are you really suggesting that not being able to hide all file extensions at once is a benefit of OS X's unix inheritance? :rolleyes:
     
  13. satcomer macrumors 603

    satcomer

    Joined:
    Feb 19, 2008
    Location:
    The Finger Lakes Region
    #13
    Sounds as if the reference file for the Finder is hosed. So quit all the running programs and the go the folder /Users/YourUserName/Library/Preferences/ and delete the file com.apple.finder.plist . Once you do that go to the Finder's menu item Preferences, Advance and make sure the check mark is un-checked. Hopefully doing this will help you.
     
  14. nope7308 thread starter macrumors 65816

    nope7308

    Joined:
    Oct 6, 2008
    Location:
    Ontario, Canada
    #14
    Still no dice...
     
  15. Posterous Rex macrumors newbie

    Joined:
    Jan 20, 2009
    #15
    Here it is. It's a global preference ( the "-g" domain" )

    Show Hidden:
    defaults write -g AppleShowAllExtensions -bool TRUE && killall Finder

    Hide Hidden:
    defaults write -g AppleShowAllExtensions -bool FALSE && killall Finder
     
  16. JKAussieSkater macrumors newbie

    JKAussieSkater

    Joined:
    Mar 13, 2009
    Location:
    Melbourne, Australia
    #16
    That's not quite so...

    That doesn't shows/hides ALL file extensions, that only shows/hides the hidden file extensions. It is exactly the same thing as de/selecting the option from the Finder preferences.

    We are looking for an option that HIDES NON-HIDDEN file extensions; that is, files that don't have the "Hide extension" box checked. If the box is checked, the file is classified as a "file with hidden extension", which the code you provided controls.

    What's interesting with all of this is that the "mac way" is to have all file extensions hidden, but we aren't given an option to have the UI the "mac way"
     
  17. j4zb4 macrumors 6502a

    j4zb4

    Joined:
    Oct 15, 2011
    #17
    Facing the same issue with ML... Still no solution it seems...
     
  18. Classamericaine macrumors newbie

    Joined:
    Feb 9, 2013
    #18
    I found a way using AppleScript. You have to write this program in AppleScript (.scpt file) :
    Code:
    on run argv
    	set posixPath to item 1 of argv
    	set posixFile to POSIX file posixPath as alias
    	tell application "Finder"
    		try
    			set extension hidden of posixFile to true
    		on error e
    			display dialog e buttons {"Ok"} default button 1
    		end try
    	end tell
    end run
    
    Then to run it on terminal :
    Code:
    $ osascript your_applescript_file.scpt complete_file_name_to_hide_extension
    
    Of course, you can make a additional bash script to contain the bash commands to launch and to add the directory to the filename or make the more complex commands but you've got the basic ideas now.
     

Share This Page