I just finished adding a portion of code to my program which reads and displays comments on image files… However, I am finding that as soon as I copy my application, or even zip, tar, etc it up… These comments are lost!
Is there an alternative way to put descriptive tags on files that will not get lost through copying?
Sorry not sure I’m following you… You have images with comments on them (spotlight I assume). Now when you do what the comments are gone?
When I copy the directory with my images… or zip the directory… any attempt to duplicate them, the comments disappear.
Hey Patrick, sadly this is expected behavior. Spotlight comments are not actually written as metadata into the files, but stored in the Spotlight data base and thus it is not retained across most changes. You can use the finder duplicate command which will copy spotlight data over, but for zipping and other such measures I’m afraid your out of luck… Unless of course you wanted to write a script that reads the source data and then after copying it rewrites it.
Ok, thanks… I am going to post a new topic regarding records, as I think this will be the best solution for what i am trying to achieve…
What I’m seeing here is that if I zip or duplicate a folder, the comments of the contained items are preserved, even when the archive or duplicate is transferred to a machine running Jaguar (ie. without Spotlight). A bit of poking around shows that the comments have been saved in the folder’s invisible “.DS_Store” file, which is of course duplicated or zipped along with the folder itself. This may offer some hope for Patrick.
I was doing my comment checking manually, and it was probably my clicking around and opening folders that encouraged “.DS_Store” to be created and/or updated. A way to force this by script appears (after minimal testing) to be:
set myFolder to (choose folder)
tell application "Finder"
tell item 1 of folder myFolder
set comment to comment
--> ".DS_Store" created in myFolder.