Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mark88

macrumors 6502a
Original poster
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:

/Volumes/External/Applications/The Unarchiver.app

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?
 
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.
 
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.

Thanks for the info, very cool indeed!

I guess I should have known given you can run an application from anywhere.
 
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.
 
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.

Doesn't that only work of iTunes is open? (at least on 10.3)
 
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...
Safari.app
Safari.app
Firefox.app
Firefox.app

Any idea how to fix it?
 
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...
Safari.app
Safari.app
Firefox.app
Firefox.app

Any idea how to fix it?

does restarting help?
 
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...
Safari.app
Safari.app
Firefox.app
Firefox.app

Any idea how to fix it?

You have to rebuild your LaunchServices database.

http://www.macosxhints.com/article.php?story=20031215144430486

Oh... or you can use Onyx to do it from a nice crunchy GUI front-end
 
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:

/Volumes/External/Applications/The Unarchiver.app

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?

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.
 
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.

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. 😱
 
You have to rebuild your LaunchServices database.

http://www.macosxhints.com/article.php?story=20031215144430486

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

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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.