[texworks] Icon Update

Bruno Voisin bvoisin at me.com
Tue Jul 14 12:16:16 CEST 2009


Le 14 juil. 09 à 08:25, Alain Delmotte a écrit :

> How do you distinguish between TeXworks produced and, let's say,  
> Oppen Office produced pdf files? In a way which allows the OS to know.
> If it is possible, I'd like it for TeXworks.

Mac OS X can associate files to applications via extensions, in which  
case all files with a given extension are associated to the same  
application, but that's a crippled version of the way file-application  
association works in OS X and more fine tuning is possible based on  
file metadata.

Before OS X, each file had associated Creator and Type fields of 4  
characters, and the notion of a file extension was unknown. For  
example, the Textures application created DVI files with Creator *TeX  
and Type DVI2, and the OzTeX application created DVI files with  
Creator OTEX and type ODVI, so that when you double-clicked a DVI file  
created by Textures it opened in Textures, and when you double-clicked  
a DVI file created by OzTeX it opened in OzTeX.

With OS X this (now obsolete) mechanism is still supported for  
backwards compatibility, so that the built-in editor of TeXShop, for  
example, creates TeX input files of Creator TeXs and Type TEXT, which  
open in TeXShop each time they are double-clicked. Similarly the  
extension mechanism is also supported for Windows and Linux  
compatibility, so that you can set in the Finder that all files with  
extension .tex are associated to TeXShop or TeXworks.

But the real way OS X works (since version 10.3 or 10.4) is by using  
Uniform Type Identifiers (UTIs) and extended attributes, so that each  
file can be associated again to a given application on an individual  
basis. UTI is supposed to merge together and enhance Type/Creator,  
extension and MIME type. I can't tell more as I never quite really  
understood how this all works, and it's way beyond my league, but the  
final message is that individual association of file with application  
seems to be possible, either set by the application automatically or  
by the user manually.

But that's probably all immaterial as it seems Mac-specific. I thought  
Windows, at least since Vista, included mechanisms going beyond  
extension matching, but maybe not.

Bruno Voisin


PS To illustrate the complexity of the matter, here are the metadata  
for a document of mine created long ago with Textures but for which I  
erased the associated Type and Creator so that it now opens with the  
default application for the .tex extension (which I set to TeXworks):

MacBook-de-Bruno-Voisin:Version 1.9 (Bruno) bvoisin$ mdls pap7.tex
kMDItemContentCreationDate     = 1998-12-28 13:10:11 +0100
kMDItemContentModificationDate = 2009-07-13 20:12:09 +0200
kMDItemContentType             = "com.bluesky.textures.text"
kMDItemContentTypeTree         = (
     "com.bluesky.textures.text",
     "public.text",
     "public.data",
     "public.item",
     "public.content",
     "public.plain-text",
     "org.tug.tex"
)
kMDItemDisplayName             = "pap7.tex"
kMDItemFSContentChangeDate     = 2009-07-13 20:12:09 +0200
kMDItemFSCreationDate          = 1998-12-28 13:10:11 +0100
kMDItemFSCreatorCode           = ""
kMDItemFSFinderFlags           = 0
kMDItemFSHasCustomIcon         = 0
kMDItemFSInvisible             = 0
kMDItemFSIsExtensionHidden     = 0
kMDItemFSIsStationery          = 0
kMDItemFSLabel                 = 0
kMDItemFSName                  = "pap7.tex"
kMDItemFSNodeCount             = 0
kMDItemFSOwnerGroupID          = 501
kMDItemFSOwnerUserID           = 501
kMDItemFSSize                  = 197647
kMDItemFSTypeCode              = ""
kMDItemKind                    = "TeX Document"
kMDItemLastUsedDate            = 2009-07-13 20:12:09 +0200
kMDItemUsedDates               = (
     2009-07-13 00:00:00 +0200
)

And here are the metadata for a document created with TeXShop and for  
which I didn't change anything:

MacBook-de-Bruno-Voisin:Version 1.9 (Bruno) bvoisin$ mdls parameters.tex
kMDItemContentCreationDate     = 2002-03-12 15:10:43 +0100
kMDItemContentModificationDate = 2009-06-25 18:32:05 +0200
kMDItemContentType             = "org.tug.tex"
kMDItemContentTypeTree         = (
     "org.tug.tex",
     "public.text",
     "public.data",
     "public.item",
     "public.content",
     "public.plain-text"
)
kMDItemDisplayName             = "parameters.tex"
kMDItemFSContentChangeDate     = 2009-06-25 18:32:05 +0200
kMDItemFSCreationDate          = 2002-03-12 15:10:43 +0100
kMDItemFSCreatorCode           = "TeXs"
kMDItemFSFinderFlags           = 0
kMDItemFSHasCustomIcon         = 0
kMDItemFSInvisible             = 0
kMDItemFSIsExtensionHidden     = 0
kMDItemFSIsStationery          = 0
kMDItemFSLabel                 = 0
kMDItemFSName                  = "parameters.tex"
kMDItemFSNodeCount             = 0
kMDItemFSOwnerGroupID          = 501
kMDItemFSOwnerUserID           = 501
kMDItemFSSize                  = 139
kMDItemFSTypeCode              = "TEXT"
kMDItemKind                    = "Document TeX"
kMDItemLastUsedDate            = 2009-06-25 18:32:05 +0200
kMDItemUsedDates               = (
     2009-06-25 00:00:00 +0200
)


More information about the texworks mailing list