# How to make a document "Open With" my app



## konan (Jul 28, 2003)

I have a creator code and have added the following bit to rez file...

#include "Types.r"

type 'xxxx'
{
  pstring;
};

resource 'xxxx' (0, "Owner Resource")
{
  "Software© 2003"
};
resource 'BNDL' (128, purgeable) {
   'xxxx',
   0,
   {
}
};

where 'xxxx' denotes my creator code. Then I assign the creator code to any file I output. If I right click on a newly created file, it shows that the file as created with my application (this is good).

Now, how do I instruct that file to automatically be opened with my application? As it is now, it is being automatically associated with another, completely unrelated program by default.

Any help would be most appreciated,
Konan


----------



## bobw (Jul 28, 2003)

Command-I
Open with
Change All


----------



## konan (Jul 28, 2003)

Now, how would I do that automatically through my application? I would prefer that the user not have to do that manually. Any suggestions?

Konan


----------



## slur (Aug 5, 2003)

What is the type of file your program makes? You cannot forcibly take over the default opener for file types which already have a handler. However, if your file is unique you could give it a unique type and extension that no other programs understand.

That said, if you're setting the file's creator to your program's creator code, and that creator code is unique to your program, then it should open in your program by default.


----------

