3
votes

I'm making a document-based application where documents are application bundles. I can open them through "File → Open" menu fine. But when I try to drop them on the Dock icon they get rejected and the icon doesn't highlight.

I've searched this issue and it seems like it should just work given that LSItemContentTypes property is specified. Here is my Info.plist excerpt:

CFBundleDocumentTypes = (
    {   CFBundleTypeName = "Example";
        CFBundleTypeRole = "Editor";
        LSHandlerRank = "Alternate";
        LSItemContentTypes = ( "com.apple.application-bundle" );
        NSDocumentClass = "Example";
        NSExportableTypes = ( "com.apple.application-bundle" );
    },
);

(I am developing outside of Xcode, this is a TextMate-formatted plist file.)

Also I tried implementing application:openFile: and application:openFiles: on my app delegate but they never get called.

There are no warnings or other related messages in the log. What am I missing?

1
Maybe add the extension? <key>CFBundleTypeExtensions</key><array><string>app</string></array> - Gerd K
Doesn't work. I don't have it because LSItemContentTypes takes precedence over it. See developer.apple.com/library/mac/#documentation/General/… - Simon Perepelitsa

1 Answers

0
votes

Perhaps you need to set LSTypeIsPackage to YES.

That's the only difference I see with your plist stuff and mine that opens packages.

After that, maybe you need to logout/login, restart the app, or whatever to "refresh the system/launch services"?