Re: Adding Spotlight comment data to folder/file
Re: Adding Spotlight comment data to folder/file
- Subject: Re: Adding Spotlight comment data to folder/file
- From: Kyle Sluder <email@hidden>
- Date: Mon, 11 Jul 2011 19:51:28 -0700
On Mon, Jul 11, 2011 at 6:31 PM, Kevin Muldoon <email@hidden> wrote:
> Program is a drag/drop app that asks user for the work order number and
> creates a directory structure customized for the client. Submitted files
> are copied into a date stamped folder within that job 'Supplied Folder'.
> I thought it would be handy to place user name/computer name which used the
> program within the comments field of that date stamped folder, therefore
> giving an extra level of tracking should it be needed. I mention spotlight
> because that is what the comments field is now labeled as you hit command-i
> on a file/folder.
Like I said, Apple designed that field for the sole use of the user.
Not that your intended feature wouldn't be helpful, but a user who
stumbled upon the output of your program occupying that slot might
wrongly conclude that it exists for the purpose of programs to store
information, not their own personal note.
Rather than fill that slot, you could write a Spotlight importer for
your file format that returns a string containing relevant information
for the kMDItemDescription attribute based on information stored in
the file. I believe this string will also appear on the Get Info
panel.
> I'm leery of calling AS through ScriptingBridge since the directories are
> created programmatically in Obj-C. I have experienced Apple Events not
> recognizing the presence of files/folder created by, lets say a shell
> script, until some moments later.
Apple Events have nothing to do with the filesystem; you are at the
mercy of whatever application you are sending your Apple Events to.
> Well, as I indicated, it's only a bit of icing on the cake. I'm just a bit
> shocked such an trivial task in a scripting language requires such heavy
> lifting in Obj-C (or more accurately, C).
You're running up against deliberate design decisions. The Spotlight
model revolves around importers. Finder comments are exposed via
scripting because they're intended for *users* to be able to automate
the Finder. Spotlight then picks up that data and adds it to its
database.
--Kyle Sluder
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden