Setting the file icon

Hello,

I missed something with documents created by my application: they are created with the correct extension, but refuse to show the correct icon. In fact, when doubly clicked, they launch… TextEdit.

I have defined a creator type for my app (EVAX, type=APPL) and defined also a file icon (type .icns), a document type (creator EVAX, type=Eval), and set the extension (.eval).

So what should I add or modify to have my icon document, and make them launch my application?

Thanks for any idea.

You need to make the launchd process aware of your new app. Drag the app in your applications folder and it will be automatically added.

Could also be the way your info.plist is setup. But try this first, I’m sure it will solve your problem.

Fred

Browser: Safari 6533.18.5
Operating System: Mac OS X (10.6)

Hello Fred,

Thank you for the reply.

It must be in my .plist… A “Get Info” on my files says they have Creator set as “ttxt” and Type to “”.

Even when I set Type and Creator for these files “manually”, it opens TextEdit. I don’t understand.

Regards

Are you setting the type and creator in code? I’ve had success with my app opening documents (with the correct icon and extension) by setting the document type, extension, and icon in the document types section that you get to by going to Project → Edit Active Target. Have you tried that? I thought that I read somewhere that Apple was moving away from creator types and toward UTIs – maybe something is overriding your settings.

Ric

Could you post your info.plist file? Maybe there’s one little thing missing that you haven’t seen yet. And I agree with rdelmar, you should use UTIs instead of creator codes… Much more future-proof.

Fred

Browser: Safari 6533.18.5
Operating System: Mac OS X (10.6)

No I don’t set anything by code - I wish to set file type, creator and icon via the .plist…

As I don’t know how to attach a file to a post, I sent it to your addresses by mail.

Regards

No way to attach a document, so this is the text version of my .plist file :

<?xml version="1.0" encoding="UTF-8"?> CFBundleDevelopmentRegion en CFBundleDisplayName EVALS CFBundleDocumentTypes CFBundleTypeExtensions eval CFBundleTypeIconFile EVALS FileIcon CFBundleTypeName Eval CFBundleTypeRole Editor CFBundleExecutable ${EXECUTABLE_NAME} CFBundleGetInfoString Evaluation assistée CFBundleIconFile Evals.icns CFBundleIdentifier IdemSoft.${PRODUCT_NAME:rfc1034identifier} CFBundleName ${PRODUCT_NAME} CFBundlePackageType APPL CFBundleShortVersionString 6.4 CFBundleSignature EVAX CFBundleURLTypes CFBundleVersion Test LSApplicationCategoryType public.app-category.education LSMinimumSystemVersion 10.6 NSHumanReadableCopyright ©IdemSoft 1990 - 2011 NSMainNibFile MainMenu NSPrincipalClass NSApplication NSServices UTExportedTypeDeclarations UTImportedTypeDeclarations

Hmmm… That all looks ok to me, I don’t see why this is not working. When I had trouble with the wrong icon showing up (even though the info.plist file was correct), the problem fixed itself when the computer was turned off and then rebooted --have you done this?

Where do you see the Creator and Type when you “Get Info” – Do you mean the “Get Info” menu item you get by control clicking (or right clicking) on a file icon? I don’t see either of those things in my info window – I do see something called “Kind” which shows my document name. Do you see this, and if so, what does it show?

Also, if you right click on one of your files and choose “Open With”, what does it show?

Ric

Ok, I turn off.

I read the Creator and Type on File Buddy (Non-Apple app). And when I right-click on my files, the menu shows my app as a possible choice… BUT I have tried to enforce an opening with my app in the GetInfo Finder window… does it count? Maybe…

Remember the time when you have a BNDL/FREF resource to set and everything worked? Ok, I’m a bit nostalgic, I confess…

I’ll be back.

Hey, I’m back to the “Rebuild Desktop” days :slight_smile:

I rebooted, changed the “eval” extension (maybe corrupted) to a new “evals” extension and… everything worked! Accidents may happen in a perfect world…

Thank you, Fred and Ric, another problem solved with your help! See you soon for the next one :wink:

Regards