• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Problems defining a UTI
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems defining a UTI


  • Subject: Re: Problems defining a UTI
  • From: Daniel Jalkut <email@hidden>
  • Date: Tue, 14 Jun 2005 20:02:38 -0700

Since nobody else has responded to this, I might as well throw this out, despite its total lack of authority or expertise :)

When I was playing around with importers in 10.4, I became convinced that to declare a UTI that gets recognized by the system, you have to do it from an application, *not* from the importer itself. In my tests, I had to create a little test app that defined a UTI, and copied it to the Applications folder for good measure.

I think I remember seeing some sample code that implied the UTI should be definable from the importer's plist, but then I saw some documentation that said it was not yet supported.

I don't know if anything changed in 10.4.1 to make it possible to define UTIs in the importer itself.

Daniel

On Jun 14, 2005, at 1:56 PM, Mark Alldritt wrote:

Hello,

I'm sorry if this is off-topic but I couldn't find a more appropriate
mailing list.

I'm trying to define a custom Universal Type Identifier as part of a
Spotlight importer and I cannot seem to make it work. The mdimport command
fails to map to my importer.


Here's the definition in my importer's plist:

    ...

    <key>UTExportedTypeDeclarations</key>
    <array>
        <dict>
            <key>UTTypeIdentifier</key>
            <string>com.latenightsw.osa.bundle</string>
            <key>UTTypeReferenceURL</key>
            <string>http://www.latenightsw.com</string>
            <key>UTTypeDescription</key>
            <string>Compiled OSA script (Bundle XXX)</string>
            <key>UTTypeConformsTo</key>
            <array>
                <string>com.apple.package</string>
                <string>com.apple.applescript.script</string>
            </array>
            <key>UTTypeTagSpecification</key>
            <dict>
                <key>public.filename-extension</key>
                <array>
                    <string>scptd</string>
                </array>
            </dict>
        </dict>
    </array>

    <key>CFBundleDocumentTypes</key>
    <array>
        <dict>
            <key>CFBundleTypeRole</key>
            <string>MDImporter</string>
            <key>LSItemContentTypes</key>
            <array>
                <string>com.apple.application</string>
                <string>com.apple.applescript.text</string>
                <string>com.apple.applescript.script</string>
                <string>com.latenightsw.osa.bundle</string>
            </array>
        </dict>
    </array>

    ...

When I use mdimport to run my importer, it works for the apple- supplied UTI
(com.apple.applescript.script):


fatmat:~/Desktop mall$ mdimport -d2 SpotlightTest.scpt
2005-06-14 13:11:34.974 mdimport[2553] Import
'/Users/mall/Desktop/SpotlightTest.scpt' type 'com.apple.applescript.script'
using
'file://localhost/Users/mall/Desktop/OSAImporter/build/Development/ OSAImport
er.mdimporter/'
OSAImporter: importing legacy script file
2005-06-14 13:11:35.032 mdimport[2553] Sending attributes of
'/Users/mall/Desktop/SpotlightTest.scpt' to server. Attributes: '{
"_kMDItemImporterCrashed" = <null>;
"com_apple_metadata_modtime" = 140464711;
kMDItemContentCreationDate = 2005-05-04 17:28:52 -0700;
kMDItemContentModificationDate = 2005-06-14 10:58:31 -0700;
kMDItemContentType = "com.apple.applescript.script";
kMDItemContentTypeTree = ("com.apple.applescript.script", "public.data",
"public.item");
kMDItemDescription = "Happy Birthday\n"; -- generated by my importer
kMDItemDisplayName = {"" = "SpotlightTest.scpt"; };
kMDItemKind = {"" = "Compiled OSA Script"; };
kMDItemTextContent = "set a to \"Amiba\""; -- generated by my importer
}'


However, when I try and run my importer against my UTI
(com.latenightsw.osa.bundle):

fatmat:~/Desktop mall$ mdimport -d2 SpotlightTest.scptd
2005-06-14 13:11:15.267 mdimport[2552] Import
'/Users/mall/Desktop/SpotlightTest.scptd' type 'dyn.ah62d4qmuhk2x465dsb4gk'
no mdimporter
2005-06-14 13:11:15.269 mdimport[2552] Sending attributes of
'/Users/mall/Desktop/SpotlightTest.scptd' to server. Attributes: '{
"_kMDItemImporterCrashed" = <null>;
"com_apple_metadata_modtime" = 140471831;
kMDItemContentCreationDate = 2005-06-13 17:07:34 -0700;
kMDItemContentModificationDate = 2005-06-14 12:57:11 -0700;
kMDItemContentType = "dyn.ah62d4qmuhk2x465dsb4gk";
kMDItemContentTypeTree = ("com.apple.package", "public.directory",
"public.item");
kMDItemDisplayName = {"" = "SpotlightTest.scptd"; };
kMDItemKind = {"" = "Compiled OSA Script (bundle)"; };
}'


I've gone over the Troubleshooting Spotlight Importers web page
(http://developer.apple.com/documentation/Carbon/Conceptual/ MDImporters/inde
x.html) several times and none of the suggested solutions for this problem
seem to work.


Can anyone point out where I'm going wrong?

Thanks
-Mark

---------------------------------------------------------------------- --
Mark Alldritt Late Night Software Ltd.
Phone: 250-380-1725 Script Debugger 3.0 - AppleScript IDE
WEB: http://www.latenightsw.com Affrus 1.0 - Perl Debugging


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
sweater.com


This email sent to email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Problems defining a UTI (From: Mark Alldritt <email@hidden>)

  • Prev by Date: Xcode 2.1 saving lag
  • Next by Date: .xcconfig files
  • Previous by thread: Problems defining a UTI
  • Next by thread: Shell Script Build Phase broken in Xcode 2.1?
  • Index(es):
    • Date
    • Thread