How is OS X this smart?

Discussion in 'macOS' started by mark88, Feb 1, 2007.

  1. mark88 macrumors 6502a

    Oct 30, 2004
    OK, today I connected an external USB drive to my powerbook. The external drive contained a clone of the hard drive of one of my other macs.

    Anyway, on the powerbook. I have no app installed to handle rar files, thus, every rar file has a blank icon and doesn't open with anything.

    However, after I attached the USB drive, suddenly the .rar files on my powerbook got a nice .rar icon and were associated with the app 'The Unarchiver'.

    This app is contained on my external drive:


    I never even attempted to open any app on the external drive while connected to my powerbook so just how does OS X know how to associate it with .rar files?

    So with no external drive attached .rar files have blank icons and open with nothing, as soon as the external drive is attached the associate with the unarchiver and get it's icon!

    pretty smart, but how?
  2. balamw Moderator


    Staff Member

    Aug 16, 2005
    New England
    Just a hunch, but probably the fact that there's no (*&^*&^%(&^$&( registry or "drive letters" and apps are self contained has something to do with it.


  3. wrldwzrd89 macrumors G5


    Jun 6, 2003
    Solon, OH
    There's a little-known service in Mac OS X that handles these things. It's called LaunchServices. What it does is scans for applications registered with it to handle certain file types and associates those files with their corresponding applications. It's even smart enough to update its database when you connect or disconnect a new drive, thanks to another feature called global filesystem notifications - the feature that makes Spotlight update its index so quickly.
  4. smueboy macrumors 6502a


    Oct 30, 2006
  5. mark88 thread starter macrumors 6502a

    Oct 30, 2004
    Thanks for the info, very cool indeed!

    I guess I should have known given you can run an application from anywhere.
  6. sushi Moderator emeritus


    Jul 19, 2002
    The other's explained it well already. :)

    But I like your answer the best! :D
  7. Soulstorm macrumors 68000


    Feb 1, 2005
    If you really want to know how smart OS X is, try this:

    Go to your iTunes preferences, and check the location for the iTunes music folder in the Finder. Go to that folder in the Finder, and rename it. Check the iTunes preferences again. Notice that it is changed?

    Although it is simple, I was impressed.
  8. thejadedmonkey macrumors 604


    May 28, 2005
    Doesn't that only work of iTunes is open? (at least on 10.3)
  9. mark88 thread starter macrumors 6502a

    Oct 30, 2004
    ok, I've noticed a slight downside to this.

    After ejected the external drive, all the apps contained on it still appear in the 'open with...' menu, so all my apps are duplicated.

    Open with...

    Any idea how to fix it?
  10. clevin macrumors G3


    Aug 6, 2006
    does restarting help?
  11. MacsAttack macrumors 6502a

    Jul 2, 2006
    You have to rebuild your LaunchServices database.

    Oh... or you can use Onyx to do it from a nice crunchy GUI front-end
  12. MacsAttack macrumors 6502a

    Jul 2, 2006
    When you connect the drive, OS X scans it for any .app (application) files (actually they are folders that look like files - but that is another story).

    All associations are stored in the LaunchService database - which is used to associate files with the corret application and gives you the "Open With..." options for any file.

    This database can get a little... err... confused sometimes.
  13. zephead macrumors 68000


    Apr 27, 2006
    in your pants
    I noticed that if I move a song from its proper place in the iTunes music folder (i.e. to the desktop) and if I play the song in iTunes, it still plays as if nothing happened! And what really baffled me about the whole iTunes/smart OS X thing is when I got my MacBook :)D) and moved my iTunes library over from my PC, I was expecting to have to do a lot of things so I could get the songs in with the library information/song stats stuff. But then I opened iTunes, my stuff was already completely there, and I was baffled that I didn't have to do anything. :eek:
  14. slffl macrumors 65816


    Mar 5, 2003
    Seattle, WA
    I've had this problem for some time. So I was excited to see this fix. However, I've tried both Onyx and MainMenu to rebuild the LauchServices database, but I still have multiple apps showing up under 'Open With..'

    Are there any other fixes for this?

    EDIT: I also tried the osxhints solution. Not only did none of these work ,now when I try and mount a dmg image, it opens up Disk Utility instead.

Share This Page