Benches macOS

13

Adding descriptions to .weblock

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

I have a library of .webloc bookmarks, and what to help Spotlight index them by providing descriptions.

DeRez cool-website.webloc reveales that there are four resources present:

* DRAG – contains information about the other resources, I guess

* TEXT – contains the URL of the page

* URL – exactly the same as TEXT

* URLN – contains the page title

Is there a standard resource I can add for descriptions that will be recognized and include in Spotlight searches? (Alternately, I will just create such a Spotlight indexer.)

Please advise. 🙂

13 replies

Sign in or join Beachball Help to reply.

  1. 0

    thomas_r.

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Select the .webloc file, choose File -> Get Info and add the description to the Spotlight Comments field. No mucking around in resources necessary.

  2. 0

    thomas_r.

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Select the .webloc file, choose File -> Get Info and add the description to the Spotlight Comments field. No mucking around in resources necessary.

  3. 0

    Macsential

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    I am aware of the generic Spotlight commenting. I was looking for something specific for weblocs (a format that really is not documented anywhere).

  4. 0

    thomas_r.

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Why do you need an alternate method specific to .webloc files? That may seem like an impertinent question, but it is not... you'll be more likely to get good answers if we have a better idea what you're trying to accomplish.

  5. 0

    Macsential

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    To get specific, a dedicated way in the same area as the resource forks (URL, and URLN) for webloc will enable me to also include it inside the webloc as XML/plist. That way, the information will not get lost in transfer or if I temporary move the files to a file system/machine that does not support resource forks.

  6. 0

    thomas_r.

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Ahh, I understand. I cannot fathom why Apple has chosen to put all the webloc data in the resource fork, after years of effort to leave resource forks behind. Seems like it would have been trivial to put it into an XML file. But, they didn't. You could always add some custom XML to the data fork yourself, perhaps even using an AppleScript to automate it. But I'm not sure that Spotlight would index it there... you'd have to test that.

    Note that your XML would be totally meaningless, from an OS point of view. If you moved the file through a Windows system and lost the resource fork, the .webloc file would not function as expected until you restored the resource file. So, that's another automated task you'd have to create: copying the data from your custom XML into the resource fork.

    Message was edited by: Thomas A Reed

  7. 0

    Macsential

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    I just found yet another undocumented Apple format .webbookmark. Used for Spotlight caches of metadata for bookmarks.

    The XML looks similar to .webloc, but the file does not have any resource forks. Still no description, though.

  8. 0

    Jeffrey Jones2

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Not all webloc's are the same. Some use the resource fork and some do not.

    -----

    Maybe my statement is only partially true. I should say "Some use the
    data fork and some do not." It appears that those with a data fork may have a resource fork as well.

    Message was edited by: Jeffrey Jones2

  9. 0

    Macsential

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    After having dissected
    Bookmarks.mdimporter I found the following:

    URL (kMDItemURL)

    Name (kMDItemDisplayName)

    Keywords (kMDItemKeywords)

    Full Page Text (kMDItemTextContent)

    Everyone works and is searchable by Spotlight. Except kMDItemTextContent, which was the one I was interested in. 🙂 Of course.

    Message was edited by: Macsential

  10. 0

    Macsential

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    DELETE ME

    Message was edited by: Macsential. I apologize for the double posting. The forums freaked out because of a control character in my text.

  11. 0

    Macsential

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Correction:
    Full Page Text did work! Spotlight freaked out from the same control character as the forums.

    My problem have been resolved. Result:

    The Register.webbookmark

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>Name</key>
    <string>Register, The</string>
    <key>URL</key>
    <string>

    http://www.theregister.co.uk/</string>

    <key>Keywords</key>

    <string>registernews</string>

    <key>Full Page Text</key>

    <string>Biting the hand that feeds IT</string>

    </dict>

    </plist>

  12. 0

    Macsential

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    I think it is strange that there is no documentation on this file format what so ever. :-/

  13. 0

    Macsential

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    For future reference, kMDItemKeywords is an array