• 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
Problems defining a UTI
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problems defining a UTI


  • Subject: Problems defining a UTI
  • From: Mark Alldritt <email@hidden>
  • Date: Tue, 14 Jun 2005 13:56:33 -0700

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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Problems defining a UTI
      • From: Daniel Jalkut <email@hidden>
  • Prev by Date: Re: Guard malloc conflicts
  • Next by Date: Re: Permanent breakpoint
  • Previous by thread: Re: Cocoa-Java-based Universal Binary?
  • Next by thread: Re: Problems defining a UTI
  • Index(es):
    • Date
    • Thread