[Pythonmac-SIG] Help: how to programmatically set "open with" app in OSX

Nicholas Riley njriley@uiuc.edu
Mon, 30 Dec 2002 13:35:35 -0600


On Mon, Dec 30, 2002 at 09:48:37AM -0800, Paul Berkowitz wrote:
> On 12/26/02 2:33 PM, "Jack Jansen" <Jack.Jansen@oratrix.com> wrote:
> 
> > how can I programmatically set the "Open with:" default for .py files
> > in MacOSX? I had expected this to work with the Internet Config API,
> > but that doesn't seem to work. Can anyone point me in the right
> > direction?
> 
> Did anyone ever answer this? I could tell you how to give it a creator code
> with AppleScript, which would accomplish exactly the same thing, but there
> must be a "proper" OS X Unixy-method, I'm sure. I'd be interested to know
> that method too.

It's private LaunchServices API, unfortunately.  From doing 'nm
LaunchServices' it appears what you want is probably
_LSSetWeakBindingForType.

It would be rather nice if Apple would expose this API...

-- 
=Nicholas Riley <njriley@uiuc.edu> | <http://www.uiuc.edu/ph/www/njriley>
        Pablo Research Group, Department of Computer Science and
  Medical Scholars Program, University of Illinois at Urbana-Champaign