[X-Unix] Changing a file's open-with program at the command line.

Jerry Krinock jerry at ieee.org
Wed Feb 10 19:34:53 PST 2010


You need to get into the Launch Services database.  There is a LaunchServices framework which is accessible by a C API, but in this post someone says they can access it from the command line:

http://www.tuaw.com/2009/06/11/terminal-tips-rebuild-your-launch-services-database-to-clean-up/

BUT, there is no man page for lsregister.  So, I don't know.  Maybe the executable in this framework also has a secret command-line interface??

You can certainly do it by writing a C program.  Although Launch Services is not a very nice API, here's the documentation:

http://developer.apple.com/mac/library/DOCUMENTATION/Carbon/Conceptual/LaunchServicesConcepts/LSCIntro/LSCIntro.html#//apple_ref/doc/uid/TP30000999-CH201-TP1

Specifically, in "Launch Services Tasks", see "Registering an Application".



More information about the X-Unix mailing list