UTI's ... again

I’m having a problem, I think its to do with UTI’s but it may be FileType definitions.

In a simple example file, I have defined 2 fileTypes.

  1. word with extension “doc”, filetype is blank
  2. actio with extension “actio” and UTI is “biz.ithought.actio”

Then, in a button.action I have:

[quote] dim dlg as new OpenDialog

dlg.Filter = FileTypes1.All

dim fi as folderItem = dlg.ShowModal[/quote]

When I run the openDialog correctly highlights just doc and actio files. But when I use the search field in the openDialog, only the doc files get listed.

I have checked the content of the UTI using mdls in Terminal. For the .doc files I get something sensible like:

kMDItemContentType = “com.microsoft.word.doc”

but for the .actio files, created in Xojo I get:

kMDItemContentType = “dyn.ah62d4rv4ge80c25yrf1u”

whereas I was expecting: “biz.ithought.actio”

I have also tried creating the files using the app compiled and wrapped with AppWrapper. Setting the UTI’s there using Sam’s instructions, but I get the same obscure UTI in mdls.

My objective is to get the Search field to correctly list all .actio files.

Does anyone know how to correctly set the UTI so that it all functions correctly?

NB This is all on Yosemite, Xojo 2014r1.


Which app is the original creator of actio files? If it’s your application, then make sure the “This application is the UTI owner” checkbox is selected in App Wrapper.

If it’s not, then in theory, providing the other application has set them up correctly, you just need to register for the UTI, but should include as much information to the system as possible.

Sam, thanks for the reply. It may be that “This application is the UTI owner” is an AppWrapper 3 function - I don’t find it in v2.

Notwithstanding that - the app that is the original creator is my app, in Xojo and the filetypes long pre-date the use of AppWrapper. Originally I had left the UTI field in filetype blank - so presumably it is Xojo (or rather RealBasic) that invented the obscure UTI.

I’ve tried putting the obscure UTI “dyn.ah62d4rv4ge80c25yrf1u” into the UTI field within the fileType definition in the IDE, but still cannot search for those files in the OpenDialog - though the filter function still works fine.

I would like to find a way of getting rid of the obscure UTI and having a human readable form instead.

Okay, let’s double check your project settings.
First your file type in the Xojo IDE. Make sure that it has all the information filled out, especially the UTI field. The icon can be left blank.

Next under build settings, select OS X and click on the “Choose” button next to FileTypes. You need to make sure that your filetype has the role of “Editor” and the checkbox to the left is selected.

Now in App Wrapper, under the UTI editor (it’s different in v2, but it will still have the same fields). Make sue the Identifier matches (mind you AW picks up if doesn’t), the extensions match and the OS types. In the Conforms To section, I seem to recall it must have public.item and public.data.

Both App Wrapper v2 and App Wrapper v3 have associated UTIs, so it does work… It’s just a fiddly process.

Oh and don’t forget to launch the application to get Launch Services to update its database.

Thanks Sam. Very comprehensive reply.

I went through every step again and still no joy. So I did 2 things and not sure which one fixed it.

  1. I deleted the fileTypes I had in the app, and recreated them.
  2. I entered the same 4 letter code in the OS X buildSettings for Creator Code as I had put in the FileTypes MacCreator field.

All that I’ve read implies that the creator code is deprecated - so it shouldn’t have been that. So was it just a faulty fileType class somehow?

I still can’t search for the old files with the obscure UTI - but I can live with that.

Now I do get a funny in the open dialog which I put down to an OS X glitch. Here’s an example:

Even though all the files were created today - one of them is sorted as if created in the year 2000. Strange huh? But that’s a glitch for another time.

Thanks for your help.


[quote=141427:@Sam Rowlands]Okay, let’s double check your project settings.
I have an issue that my file extension is no longer assigned to my app and when I go and test on a clean system, then the datafile icon is not shown either.

AppWrapper3 says: “Orphaned UTI …”

What does that mean, and how do I make it un-orphaned again? Before I could double-click a .prodb file and it was opened in my application. Somehow I have lost this.

My settings:

FileTypes in Xojo:

Types in OSX Build settings:

Settings for UTI in AppWrapper 3:

Hi Oliver, it looks like the UTI settings within the Xojo filetypes are missing. Add in the UTI to the UTI field within Xojo and it should work.

Thanks Sam, once again! Yes, that was it and it works now.

No worries and glad I could help :slight_smile: