New file type editor results in wrong or blank file icons

After using the new file type editor I can’t get Finder in El Capitan to show the correct icons. The main file shows an icon from years ago. Some new icons aren’t there at all. Do I misunderstand how to use the new editor? This is for the file with the missing icon:

Is this correct? The terminology with imported and exported isn’t very clear.

In view by Icon, I also have troubles with my Application documents… and El Capitan (and 10.10 too)… I got them in 10.11.0, .10.11.1, but lost them in 10.11.3… they are ‘overwr-ited’ by the Apple’s defaults.

A double-click in my custom icons launch correctly my application.

And in View by List: I got my icons !

I nearly forgot: Xojo 2015r1. ;-:slight_smile:

[quote=243921:@Beatrix Willius]After using the new file type editor I can’t get Finder in El Capitan to show the correct icons. The main file shows an icon from years ago. Some new icons aren’t there at all. Do I misunderstand how to use the new editor? This is for the file with the missing icon:

Is this correct? The terminology with imported and exported isn’t very clear.[/quote]
Imported and Exported are Apple’s terms if I recall correctly.
Imported means your app only reads the file.
Exported means your app reads and writes the file.
An app that Exports a filetype overrules an app that only imports it when double clicking in the finder.

I see your icon in the well, but in the effort of covering all the details, did you double click the icon and set an image for all sizes?

Here’s some help on resetting the icon cache, it may help you see the proper icons in Finder: https://gist.github.com/fabiofl/5873100

Usually if the app has all the proper icon files in it, and everything is defined in Info.plist, any “old” or “blank” icon showing up in your Finder is just a local problem (which resetting the cache should fix)

Imported and Exported are Apple’s terms if I recall correctly.
I do not know. Really ?
Wasn’t there IMPORT and EXPORT in the original Microsoft BASIC ? (yes, 40 years ago or so ?)

Imported means your app only reads the file.
Or: read a copy of the selected file. An attempt to save it will issue the Save As mechanism.

Exported means your app reads and writes the file.
Note: reads above have to be removed. The data may comes from an Import, Open, New added data, Pasted from Clipboard, etc.

We have to think for Export: "Make a copy of the current data into a file in mass storage.”

Save the current data into a different file, but the current one stays in use (a standard save will write in the original file loaded with Open

Open: open a file, read its contents, displays the contents on screen (usually) and keep a link to the file setting its read flag to true.

Save: takes the current data and write them into the original file (replacing that file contents with the current data). The original creation date is supposed to be kept, while the modification date change to “now”.

I hope I am correct.

Don’t I need to rebuild the Launch Services database for changing the file icons instead of the dock icon cache?

Anyhow. One problem is solved. I had a build script for copying icons. This was for an older version of Xojo which didn’t have support for 1024x1024 icons.

What is the entry “Icon file name” in the Exported Type ITIs part of the plist for? It’s blank for my app. Checked Xojos plist and there it’s blank, too?

[quote=244105:@Beatrix Willius]Don’t I need to rebuild the Launch Services database for changing the file icons instead of the dock icon cache?

Anyhow. One problem is solved. I had a build script for copying icons. This was for an older version of Xojo which didn’t have support for 1024x1024 icons.

What is the entry “Icon file name” in the Exported Type ITIs part of the plist for? It’s blank for my app. Checked Xojos plist and there it’s blank, too?[/quote]
I just googled a bit for fixing the icon cache, linked the most reasonable sounding one. I recall Sam mentioning something about Launch Services though, might be worth more searching.

It sounds like “Icon File Name” changes the final MyGreatIcon.icns filename inside the bundle. Test to confirm.

Beatrix,

what do you get int the Clipboard when you:

a. in the Finder, Get Info in one of YOUR document (where your custom icon is meant to be used/displayed),

b. Click in the Icon in the Get Info window,

c. Press cmd-c (or Edit Menu --> Copy)

d. then in the Edit menu, choose “Display the Clipboard” (or something like that)
OR
Launch Preview and File --> New / cmd-n

Results here:
In the Finder window, my document shows an OS X icon,
In the Clipboard, I get MY custom icon.

Also, using XCode (double-click in the .prefs file), you will get a less cryptic display of the plist contents. For example:

Icon File Name display the used icns file name for this document entry.

I’ve made some searches yesterday and… here I go (very small vs my yesterday’s report not send):

  1. You may read this document:
    Web page that (try to) explain File Type Sets.

  2. The large green dot (in your screen shot) is Red by default. Green means your declaration is ok (!)

  3. There is an error in the Display Name implementation (since ages):
    The Display Name property cannot recive (for example) text/plain because this string is displayed to the user, but Text Document (for example).

  4. The real place to put text/plain is…
    In the MIME Types (Document MIME Types).

  5. Still in the same screen shot (developer.xojo.com): beware of what you put in the Extensions field: the user will see the whole text. What user need to see these type extensions: .bas, .class etc. ?

  6. What is the OS Type ?
    What does it do ?

  7. Rules for the large colored dot ?

Red: we can imagine,

Green: when I saw Karen screen shot, I am starting to be dubitative.

  1. As Karen already ask:
    What are the meaning and use of the two RadioButtons (Imported / Exported ?

The white doc with a blue arrow change depending on the clicked value. This is not enough helpful.

Even the timed displayed text (a nice idea, but *) help is not enough.

  1. I saw in the plist, a LSisAppleDefaultForType Boolean property.
    This does not exists in the File Type Set / nor in the info.plist generated by Xojo.

  2. How do I remove a file entry ?

  3. Yes, I am nearly the only one who cares about file foot print, but:
    The project size grows from 12.8MB to 57.5MB… after I deleted my 3 custom icons (from the Navigation pane) and place them in the Icon of the File Type Set.
    I do that when I realized that I had two sets of 3 icons in my Stand Alone (which was normal since I changed things in my project).

You can imagine how slow a project load can be on computers without SSD / i7…

Sorry, I wanted to make it short…

  • The display time is a bit short, but moving the mouse will display it another time and allow me enough time to read.

[quote=243994:@Tim Parnell]Imported and Exported are Apple’s terms if I recall correctly.
Imported means your app only reads the file.
Exported means your app reads and writes the file.[/quote]
We’ve had various discussions about this, because it really isn’t clear and different devs can read the same Apple docs and come away with different understandings.

Here’s my understanding.
Exported means that your application OWNS the document, even if in other settings you’ve set otherwise. Exported should never be used except for file types explicitly to your application. I think it should be called “Exclusively”.
Imported is for everything else.

How do I know?.. Because I was responsible for breaking lots of peoples computers, by allowing my application to OWN pdf files. http://ohanaware.com/support/index.php?article=how-not-to-break-preview.html

I too went thru the wrong icon problem: sometimes I could see then all right in view by icon mode but not in list mode, and viceversa.
I googled for generic icons El Capitan and followed the suggestions, more or less four or five suggestions, and at the end, after some Restarts, my icons showed up all right.
Yet a user who followed my own steps, could not get rid of the generic or wrong icons. Only a couple of days ago he reported that, while he was doing something else, all at once he noticed that on the desktop all the generic icons turned all right.

This topic annoyed me so much so that I did some procrastination. Thanks for all the tips but

  • nothing worked so far
  • if an issue happens on 2 computers something is wrong

After staring at the plist file for a minute I noticed something: is there a relationship between the entries for Imported/Exported UTIs and Document Icons? The file without the file icon shows up at Exported UTIs while the file with the old icon shows up for Exported UTIs AND Document Icons. The main project file is rather old. Perhaps this is a Xojo problem when using the new file type editor for older projects.

Document types should ONLY be the list of files types that your application can open (those added to the OS X build item > filetypes)

Exported types launch services examines to know what types & icons you defined and what icons to show for them

Old IDE’s defined these two entries in the plist incorrectly

2015r4 separates these correctly but I dont recall if this was fixed in an earlier version (possibly 2015r3)

I’m using 2015r4. But I don’t get the difference between Document types and Exported UTIs. I’ve got 7 Exported UTIs. But only 3 of these show up as Document Type. One of the missing 4 is an index file that doesn’t need to be opened. But what about the rest? And even the index file doesn’t show it’s file icon.

Document types are types your app can OPEN / EDIT / etc

Exported types are ones YOUR application defines
In old Mac OS terms your the “creator” of the type
Other apps may know how to open the types you EXPORT but your the “originator” of the type

For instance, Preview can open PDF documents - it knows about the type & can read them
So in its plist you see (and note it CAN apply its own icon in the doc type list in case no others exist)

<key>CFBundleDocumentTypes</key>
	<array>
		<dict>
			<key>CFBundleTypeIconFile</key>
			<string>pdf.icns</string>
			<key>CFBundleTypeRole</key>
			<string>Editor</string>
			<key>LSIsAppleDefaultForType</key>
			<true/>
			<key>LSItemContentTypes</key>
			<array>
				<string>com.adobe.pdf</string>
			</array>
			<key>NSDocumentClass</key>
			<string>PVPDFPageContainer</string>
		</dict>

But its not the originator of the type (acrobat or some other app is) so it doesnt EXPORT the type

On the other hand Xojo accepts & defines the “Real Studio Project” type
So since it accepts that type it is in the doc type list

   <key>CFBundleDocumentTypes</key>
   <array>
      <dict>
         <key>CFBundleTypeName</key>
         <string>Real Studio Project</string>
         <key>CFBundleTypeIconFile</key>
         <string>REALbasicProject.icns</string>
         <key>CFBundleTypeOSTypes</key>
         <array>
            <string>RbBF</string>
         </array>
         <key>CFBundleTypeExtensions</key>
         <array>
            <string>rbp</string>
         </array>
         <key>LSItemContentTypes</key>
         <array>
            <string>com.xojo.project.legacyrbpproject</string>
         </array>
         <key>CFBundleTypeRole</key>
         <string>Editor</string>
      </dict>

AND its also in the exported type list

<key>UTExportedTypeDeclarations</key>
   <array>
      <dict>
         <key>UTTypeIdentifier</key>
         <string>com.xojo.project.legacyrbpproject</string>
         <key>UTTypeConformsTo</key>
         <array>
            <string>public.data</string>
            <string>com.xojo.project</string>
         </array>
         <key>UTTypeDescription</key>
         <string>Legacy REALbasic project</string>
         <key>UTTypeIconFile</key>
         <string></string>
         <key>UTTypeTagSpecification</key>
         <dict>
            <key>public.filename-extension</key>
            <array>
            <string>rbp</string>
            </array>
            <key>com.apple.ostype</key>
            <array>
               <string>RbBF</string>
            </array>
         </dict>
      </dict>
  1. Have you any other older version of the app on the same disk? Remove it or at least zip it.
  2. If you have files that used to be opened by that app, change their icon in their Info win.
  3. Shut down and Restart were my friends.
    After spending a lot of time with Xojo’s filetypes, the issue showed up to be Finder-related (as I said in a post above).

Yes
We ran into this with old versions of Xojo on people machines as well and the only way to see we were in fact doing the right things was to zap launch services and then force it to NO recache all the old versions

Or simpler - start a new instance of 10.7 (8, 9, 10 or 11) in a clean VM and install the latest version of Xojo there & voila it’s all right

Old versions in the launch services db can cause incorrect items to show because the older versions of Xojo DID create incorrect plists :frowning: :frowning: :frowning:

Have you tried booting the Mac as guest or in safe mode? If the icons show all right, then you know that you don’t have to spend time with file-types.

Safe mode have collateral damages: firefox id & passwords are lost (if I recall correctly). But other solutions too can have drawbacks.

I’m getting now the difference between Exported UTIs and document types. The problematic icons are from files that only my app writes.

But how do I define the document types in Xojo? When I create a simple app that is just a file type declaration for an Exported UTI and a couple of lines of code that opens and creates such a file I only get an Exported UTI and no document type.

In the OS X build section, you need to make sure that the document type is checked and the role is specified.