MacOS – Double Click to Open Program Mac

clickmacos

If I click on a .txt file, what exactly happens in order for Mac OS X to open my txt file with the Default Program (TextEdit in my case). In other words where does Mac OS look/what exact steps are involved to determine what my default program is and to open that file ?
Where can this look up /process potentially/most likely be broken and how can I troubleshoot if Mac won't open the default program. Not for all programs but for one specific program ?

Best Answer

Rebuilding Launch Service Database did the trick:

/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user

More details here:

http://www.maclife.com/article/howtos/how_rebuild_launchservices_remove_duplicates_open_menu