views:

31

answers:

1

Is it possible to use an Apple Script or a Unix executable to associate a file type with an app?

My problem is I'm using File Vault and it forgets previous associations (it's a well known bug so it seems). For instance, I like to use Flying Meat's Acorn for my graphics files rather than Preview. I can Cmd-I, change all, and while it sticks for one file the next time I reboot it's forgotten the association for everything else.

This has been driving me nuts for literally years. Any ideas?

A: 

I use Magic Launch and would highly recommend it. Not only can you associate programs with certain file types, but you can establish complex rules for when to use what app.

Or, to better answer your original question, you could try this:

defaults write com.apple.LaunchServices LSHandlers -array-add \
"<dict><key>LSHandlerContentType</key><string>public.png</string><key>LSHandlerRoleAll</key><string>com.flyingmeat.acorn</string></dict>"
bosmacs
Thanks for this. Perhaps there is a problem between my chair and keyboard -- this doesn't appear to want to work on my system. File associations are preserved between logins but don't survive reboots still. Same goes with Magic Launch unfortunately.
julesallen