I want to have an extension, named .content, to store all files in it that are linked to the filename. The extension ".content" should be recognized by the OS as a file extension rather than a regular map. The files in the extension should be only reached by opening the extension by the option "Show Package Contents". I hope someone can offer me a solution to my problem.
Folders that end with .bundle already act that way. They are opened in Terminal by default though.
The file type is defined in
To make folders that end with .content be treated as packages, add an entry like this:
Then rebuild the Launch Services database to apply the changes:
You could also add this to a CFBundleDocumentTypes array in the Info.plist of any application:
To apply changes, rebuild the Launch Services database or touch the application bundle. If the application is signed, modifying the Info.plist invalidates the code signature though.
OS X ships with a set of extensions that map to specific applications (and most of these map to Apple provided apps) so you could petition Apple to make the change, but that would be unlikely.
The other mechanism to inject a specific .extension to Application mapping into the Launch Services database is to install an Application that tells the system to map certain file types and extensions to that specific Application.
So, to keep things on-topic here let's just direct you to Stack Overflow to ask how to make your own Application. If you're not looking to develop an application, you could also just modify the app you want to open your custom file extension by changing it's interal info.plist file:
Sorry if this level of detail is more technical than you want, but I wanted to answer this for anyone that needs to know how to modify things.