UTI & files

[quote=24396:@Norman Palardy]UTTypeTagSpecification

public.filename-extension

checksums
[/quote]

that fixed part of the issue. the files are now showing their custom icons. they are just still being opened in TextEdit.

I will see if switching to binarystreams over text*streams will fix the difference.

thanks everyone that has helped so far!!!

Are you running mdls on the right file?

kMDItemFSName = “.DS_Store.checksums”

makes me wonder, unless you’re writing an invisible file? What happens if you use a regular filename like myfile.checksums. I don’t know if the OS does “special” things with dot files… or with .DS_Store in the name.

[quote=24402:@jim mckay]Are you running mdls on the right file?

kMDItemFSName = “.DS_Store.checksums”

makes me wonder, unless you’re writing an invisible file? What happens if you use a regular filename like myfile.checksums. I don’t know if the OS does “special” things with dot files… or with .DS_Store in the name.[/quote]

yes that is the correct file name. Normally I do other files/filenames (without the leading “.”) but for testing that is the only file located next to the app. and I am too lazy right now to move another file there.

if I rename the file without the “.”, the same things happen.

Aha! Change:

UTTypeTagSpecification

public.checksums

checksums

to:

    <key>UTTypeTagSpecification</key>
     <dict>
       <key>public.filename-extension</key>
       <array>
         <string>checksums</string>
       </array>
     </dict>

works here!

yeah the KEY is “what are you using to identify your files uniquely” and there are a handful of settings like extension, type , mime/type etc

Right, the UTTypeTagSpecification dictionary can contain the keys

com.apple.ostype
public.filename-extension
public.mime-type

each being an array of strings that identify your file type.

In the OS X build settings, have you set the ‘Role’ of that file type to “Editor”?

I just created a test application to try and reproduce the issue and instead of a text document, my mac thinks that .checksum is registered to Microsoft Excel!

So I set the creator to the test application and now I cannot open the file because it’s not signed! There is something fishy going on here. I wonder if it’s the file extension itself… I’ll try with a different extension.

Okay - so I added an icon image to the file type, it doesn’t display that icon and by default it associates that type of file to Microsoft Excel. Now when I change that, it opens in the test application.

Excel claims that TEXT is one of the types it can open (defined in the Document Types array) along with a HOST of others
And it does this using an OS Type code

Their list of claimed types is kind of long

Okay - I’ve figured it out and have it working here.
In the file types editor, make sure that icon is present.

Under the OS X build settings, in the “File Types” dialog, make sure that the file types are checked and the roles are set to “Editor”.

In App Wrapper, make sure that the UTIs are listed.

Then double click each UTI and make sure that the “Conforms To UTI Type” includes both “public.item” and “public.data”.

I can also share the test project if anyone is interested, and I’ll update App Wrapper so that it automagically adds both “public.item” & “public.data”.

I’ll investigate a way of simplifying the whole process from within App Wrapper, as it’s a bit of a mess with having to check 4 places to make sure that UTIs are working, in contrast when using the ‘old’ method, you only need to check two places.

Yeah the IDE really needs a way to deal with UTI’s better
<https://xojo.com/issue/11196>

Okay, so I made a quick change to the current App Wrapper beta version, now when you use the “Create UTI” button, it automatically adds “public.data” to the “Conforms To UTI Types” dialog.
http://www.ohanaware.com/appwrapper/AppWrapper220Beta.zip

I’m going to do some more research, if it’s required to have “public.data” specified, then I’ll get AW to check for it.

This is awesome work, Sam. Thank you!

Thanks Bob.

The problem that ran into with App Wrapper not including “public.data” is that this is the base type. Every UTI must ‘inherit’ this type somewhere.