I’m working on a script that performs actions on a file if the file has no default application associated with it.
In testing my script I used an old WordPerfect for DOS file named filename.WPF.
At one point, I opened that file in TextWrangler. Now OS X insists on treating TextWrangler as the default application for this file and any file with a .WPF extension.
Is there a way to clear the default application setting for .WPF files?
Thanks for that! I actually tried RCDefaultApp, but when I chose from the menu for the WPF extension, it replaced TextWranger.App with DoNothing.app. I wonder if there’s a way to remove the default application setting entirely, or if that’s just impossible under OS X…
I think it should be possible, you should have a look at extensions as well, as uti’s, and try checking of “Override creator”
I think this is where the removing of file creator type kicks in! To assure that no default app turns up.
Have a look at the aformentioned article at daringfireball.net! (daringfireball.net is searchable, if you search for creator type, I am sure something turns up, regarding BBEdit!
It doesn’t say anything about removing default applications, but I’ll experiment.
I got rid of the default application for WPF by editing com.apple.LaunchServices.plist in my Library/Preferences folder. I searched for WPF and deleted the whole key. I then restarted the system, and there is now no default application for WPF.
I don’t know whether RCDefaultApp would have fixed this by itself if I had restarted after using it, but I will experiment later and report.
I think the way you did it, was the easiest. I’ll be sure to remember that way to do it until next time!
The article I read, was about uti’s and creator types, and how to get rid of it, because if you get rid of it, then you get rid of the uti, and the default app. Gruber’s objective in the article, was to get rid of the default app, and be asked, like you, about what application to launch!
The OS will then ask you for an app to open your file with.
Maybe things have changed, but I am on Snow Leopard, and a uti of a file here, is decided by an algorithm which takes the file extension, and the creator type into account. Not that it matters much, but the document Hank posted a link to, is from November 2009, (shortly after the release of SL), and the aformentioned algorithm for deciding uti’s should therefore also apply to that document as well.
But the way to tinker it, say if you want to have a choice when opening a html file for instance, is to remove the file creator type, as that should then disable the default.app I’ll actually do that almost right away, to see if theory and practice correlates!
I have had some pre Snow Leopard memories here (Tiger), you can really only set another default app on a per file basis with finders info window. This fine article by Mr. John Gruber explains it all.
I have have however circumvented the problem, by setting a new default app manually for a file, and then run a script I have written to set another default app for a subtree, there at least also used to be one or two small apps that did something similar for a group of files in one go.
Here is the script. You first set another app as the default app on one of the files, choose two, it then works out the differences needed to be made, then you are prompted for a subtree, then it will change the default app for every file of that kind in the subtree