FROM : Charles Srstka
DATE : Fri Nov 01 23:40:02 2002
If it's possible, I would suggest setting the user-specific information
that gets set when you change a file's associated app using the Info
window in the Finder. Since that information is user-specific, your
users will be able to easily change the setting, and people they send
the files to will be able to have the files open with their chosen app.
Unfortunately, I'm not sure how to set this programmatically, but it
might be that someone else on this list knows.
Charles
On Friday, November 1, 2002, at 02:02 PM, James Derry wrote:
> Thanks, Dave.
>
> Following your suggestion, I found out through a very circuitous route
> that
> Cocoa actually supports these directly now. By overriding
> fileAttributesToWriteToFile in my MyDocument class, I was able to
> stick in a
> NSFileHFSCreatorCode key and a NSFileHFSTypeCode key, allowing the
> owner/file type to be written to the file on HFS systems.
>
> Now I get perfect icon behavior, although I think I'll add some logic
> to
> distinguish between "created" files and "processed" files created by
> another
> application. Maybe even a preference to control this behavior. Anyone
> have
> any UI rules to quote about that approach?
>
> As always,
>
> Thanks!
>
> On 11/1/02 11:45 AM, "David Remahl" <<email_removed>> wrote:
>
>>> Hi all once again,
>>>
>>> The archives haven't been much help in my particular question -- if
>>> it's been
>>> covered, I humbly apologize!
>>>
>>> I'll preface this by saying that I *can* make document icons work
>>> for *my
>>> own* file types, e.g., document.mytype.
>>>
>>> Where I'm running into trouble is getting my document icons to stick
>>> for
>>> other, competing file types. For example, imagine I'm trying to
>>> process
>>> .html, .htm, and/or .php files -- saving a document uses the icon
>>> for the
>>> default program for the file type. In this case, BBEdit for .php
>>> files, and
>>> Mozilla for .html/.htm files. Sure, when processing pre-made files,
>>> I'm not
>>> necessarily against this behavior. But when creating a NEW file and
>>> saving
>>> it, I think it should use my own icons.
>>>
>>> Of course, when I Get-Info in Finder, my program's saved files --
>>> even the
>>> ones my program created -- are "open with" BBEdit and/or Mozilla.
>>> When I
>>> change the "open with" setting, my icons pop up normally. But I
>>> guess I feel
>>> I shouldn't have to change the "open with" on files that my own
>>> program
>>> saved.
>>>
>>> Under pre-X systems, I'd look at creator codes, but these sadly seem
>>> to have
>>> disappeared for Cocoa applications, although I found lots of good
>>> stuff for
>>> them in Carbon documentation (which I don't really want to tackle!).
>>>
>>> Any ideas, or at least a concrete place I can look to figure it out
>>> myself?
>>>
>> You will have to use the types/creator API's from Carbon, although
>> those are
>> slightly deprecated.
>>
>> / david
> _______________________________________________
> cocoa-dev mailing list | <email_removed>
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/cocoa-dev
> Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
DATE : Fri Nov 01 23:40:02 2002
If it's possible, I would suggest setting the user-specific information
that gets set when you change a file's associated app using the Info
window in the Finder. Since that information is user-specific, your
users will be able to easily change the setting, and people they send
the files to will be able to have the files open with their chosen app.
Unfortunately, I'm not sure how to set this programmatically, but it
might be that someone else on this list knows.
Charles
On Friday, November 1, 2002, at 02:02 PM, James Derry wrote:
> Thanks, Dave.
>
> Following your suggestion, I found out through a very circuitous route
> that
> Cocoa actually supports these directly now. By overriding
> fileAttributesToWriteToFile in my MyDocument class, I was able to
> stick in a
> NSFileHFSCreatorCode key and a NSFileHFSTypeCode key, allowing the
> owner/file type to be written to the file on HFS systems.
>
> Now I get perfect icon behavior, although I think I'll add some logic
> to
> distinguish between "created" files and "processed" files created by
> another
> application. Maybe even a preference to control this behavior. Anyone
> have
> any UI rules to quote about that approach?
>
> As always,
>
> Thanks!
>
> On 11/1/02 11:45 AM, "David Remahl" <<email_removed>> wrote:
>
>>> Hi all once again,
>>>
>>> The archives haven't been much help in my particular question -- if
>>> it's been
>>> covered, I humbly apologize!
>>>
>>> I'll preface this by saying that I *can* make document icons work
>>> for *my
>>> own* file types, e.g., document.mytype.
>>>
>>> Where I'm running into trouble is getting my document icons to stick
>>> for
>>> other, competing file types. For example, imagine I'm trying to
>>> process
>>> .html, .htm, and/or .php files -- saving a document uses the icon
>>> for the
>>> default program for the file type. In this case, BBEdit for .php
>>> files, and
>>> Mozilla for .html/.htm files. Sure, when processing pre-made files,
>>> I'm not
>>> necessarily against this behavior. But when creating a NEW file and
>>> saving
>>> it, I think it should use my own icons.
>>>
>>> Of course, when I Get-Info in Finder, my program's saved files --
>>> even the
>>> ones my program created -- are "open with" BBEdit and/or Mozilla.
>>> When I
>>> change the "open with" setting, my icons pop up normally. But I
>>> guess I feel
>>> I shouldn't have to change the "open with" on files that my own
>>> program
>>> saved.
>>>
>>> Under pre-X systems, I'd look at creator codes, but these sadly seem
>>> to have
>>> disappeared for Cocoa applications, although I found lots of good
>>> stuff for
>>> them in Carbon documentation (which I don't really want to tackle!).
>>>
>>> Any ideas, or at least a concrete place I can look to figure it out
>>> myself?
>>>
>> You will have to use the types/creator API's from Carbon, although
>> those are
>> slightly deprecated.
>>
>> / david
> _______________________________________________
> cocoa-dev mailing list | <email_removed>
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/cocoa-dev
> Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
| Related mails | Author | Date |
|---|---|---|
| James Derry | Nov 1, 17:31 | |
| Chris Ridd | Nov 1, 17:59 | |
| James Derry | Nov 1, 21:02 | |
| Charles Srstka | Nov 1, 23:40 |






Cocoa mail archive

