Making a new file-format

I am developing an AppleScript Stuido app that needs to save a file that contains entries for a database and I wanted to create a file-format to do that. If you look at a .doc file it has a custom icon and such and automatically opens with Word. How do I create a file-format in Xcode?

Yes, I’m new.