Write Filename to Spotlight-Comments

hi!
i'm trying to batch-write the filename to the spotlight-comments (in automator or anywhere else). can someone help me on that?
regards tom

paste the following into Applescript Editor, select the files whose comments you want to change and press 'run' in script editor.
<pre style="
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
margin: 0px;
padding: 5px;
border: 1px solid #000000;
width: 720px;
color: #000000;
background-color: #ADD8E6;
overflow: auto;"
title="this text can be pasted into the Script Editor">
tell application "Finder"
set mlist to selection
repeat with thefile in mlist
set comment of thefile to comment of thefile & return&name of thefile
end repeat
end tell</pre>

Similar Messages

  • Spotlight returns MORE than just filename or Spotlight Comments?

    I am getting search returns on jpegs, with words than seemingly have nothing
    to do with the filename or "Spotlight Comments." Is there other metadata I can't see?
    How do I access it?
    Thanks!

    Seen this:
    http://developer.apple.com/mac/library/documentation/Carbon/Reference/MetadataAt tributesRef/MetadataAttrRef.html

  • No spotlight comment access

    This is a permission problem (I think) that
    prevents me from accessing the Spotlight
    window to write comments to a *.MOV file.
    Checking the *.MOV file with Terminal shows
    the permissions as :
    ls -l IMG_9698.MOV
    -rwxr-xr-x@ 1 paulphilippon  staff  26496387 Nov 27  2010 IMG_9698.MOV
    Command-i for the file shows:
    Sharing & Permissions:
    You have custom access
    Name                        Privilege
    paulphilippon (Me)  : Read & Write
    staff                         : Read only
    everyone                 : Read only
    Label and Stationery pad are grayed-out.
    I’d like to write into the Spotlight Comments window.

    Thanks for the suggestion.
    I even gave R&W to everyone and Spotlight window still has no access.
    I don't know if this is relevent, but this file was extracted from iPhoto Lib
    using Termimal. I cd'd to iPhoto Lib, listed contents and copied using
    cp -p to outside the Lib.

  • Need help modifying Applescript to copy "Spotlight Comments" into file

    Hello all,
    I have a very large batch of images of Leonardo da Vinci's notebooks. I used the "Spotlight Comments" field of each file to save information about the notebook page depicted in each image:
    Well, I had to modify each image in Photoshop and when I saved the files, Photoshop of course didn't retain the Spotlight Comments. Now, before I modified the images, I duplicated the directory, so I have a copy of all of the images that retain their Spotlight Comments field with each image's information. What I want to do is copy the text from the Spotlight Comments field of the original files and either paste this text into the Spotlight Comments field of the modified files (which are in a different directory, but retain the same filenames as the originals), or at least copy the text from the Spotlight Comments field of the original files and paste each block of text into a txt file with a couple of blank lines in between each entry, so that I can manually copy/paste the citations into the modified image's Spotlight Comments fields.
    I successfully used this Applescript:  https://discussions.apple.com/message/6741062#6741062
    to get the Spotlight Comments from the original files, but it displays them one by one in pop-up dialog boxes and because I have almost a thousand images it is extraordinarily wearisome to copy the text from each pop-up, paste it into a text file, make two blank lines, click "OK" in the pop-up to get the next one...
    Can anyone suggest how I can modify the code I have to tell the Finder to copy the contents of each pop-up and paste them into a single text file with a couple of blank lines between each entry?
    I have the barest, most rudimentary knowledge of Applescript, which is why I'm asking if one of the wizards here can help me modify or write an Applescript to do what I need to do.
    Thank you so much!
    BTW, here is the code from the aforementioned discussion that gets the Spotlight Comments from files. I made into an Applescript application using Automator:
    tell application "Finder"
    repeat with tItem in input
    set (comment of tItem) to (text returned) of (display dialog "Spotlight Comment: " default answer (comment of tItem as string))
    end repeat
    end tell

    Hi,
    Evan Izer wrote:
    Now, before I modified the images, I duplicated the directory, so I have a copy of all of the images that retain their Spotlight Comments field with each image's information. What I want to do is copy the text from the Spotlight Comments field of the original files and either paste this text into the Spotlight Comments field of the modified files (which are in a different directory, but retain the same filenames as the originals)
    This script does exactly that:
    set sFolder to (choose folder "Select folder wich contains original images.") as string
    set dFolder to choose folder "Select folder wich contains modified images."
    tell application "Finder"
          repeat with tItem in (get document files of dFolder)
                set origFile to sFolder & (get name of tItem)
                if file origFile exists then
                      set origComment to comment of file origFile
                      set comment of tItem to origComment
                end if
          end repeat
    end tell

  • Spotlight Comments - questions, limits and opinions

    My wife and I are a little behind the curve. We updated our MacBook Pros, MacPro and PowerMac G5 to Leopard early this year in part due to the fact that my testing showed that Spotlight Comments are persistent on our home ethernet - If I put identifying comments in a file's Get Info > Spotlight Comments box while it is on my MacBook's Desktop, then move it to a "file server" (a shared drive on the PowerMac or MacPro), my wife can see and modify the Comment from her MacBook. The comments almost seem to be part of the file itself (yes, Francine, we know they really are not) unlike the volatile pre-X Finder Comments. We do not normally have any Windows machines on our network and when we do we certainly do not use one as a file server. We're pretty much vanilla Apple.
    Now, on to my questions:
    1 - if not in the file itself, where are the Spotlight Comments actually stored? If they're in a folder's .DS_Store files, then they would disappear if you nuke those files (like when trying to fix a folder that is not properly displaying its contents) and that has not been my experience. I know that you can use mdls in the Terminal to show the comment and the other useful stuff that appears in Get Info's More Info field, but can this data get separated from the file it is connected to, or is it in that mystical Resource Fork? I'm not a developer (JavaScript is about as much code as I can handle) so I don't need the gory details. I just want to know if we can nuke Comments by unintentionally deleting some invisible file.
    2 - What are the limits in Spotlight Comments? Are there any? How many characters will that field take? I am asking this since I have been trying to put info concerning an image into its Spotlight Comment field and once I close the Get Info window the Comment is gone. If I check with mdls in Terminal the image's kMDItemFinderComment field is not even created. I have been trimming off hunks of characters in the Comment and am now below 700 but it still won't take it (the file is not locked, I have full control of it, and it doesn't appear to matter what files' or folders' Comments field I try to paste it into). Is this limit documented anywhere, because I've been Googling for it all morning with no matches.
    3 - if not Spotlight Comments, then what? I see DefaultFolder has an option to write Comments as "OpenMeta Tags" but what little I could understand upon looking that up made it sound like they're Spotlight Comments that are embedded into the file itself - even files that do not normally have a spot for Comments. Putting the description in the filename is much easier in X than previously, but gets a bit unwieldy very quickly. Many (but not all) image formats can accept descriptions in things like EXIF, but doing so changes its Modification Date and screws up our sorting...
    4 - only tangentially related: how many years did it take for Apple to put in Safari a function that we made use of all the time in Netscape & IE in pre-X times: put the source URL of a download in the Comment field. Now why can't the Mozilla team put that in Firefox? It's not like I haven't posted that as a feature request multiple times...
    I know that file "tagging" is a hot topic and I do not expect a real solution here, but if someone can confirm that there is a character limit in a file's Spotlight Comment field and let us know where or if it's documented...
    Message was edited by: Notary Sojak

    UPDATE - apparently once a file's kMDItemFinderComment field is created (I got the Comment to stick once I was below 600 characters) it can take more characters. I jut replaced the successful 595 character comment with the full 735 character comment I had initially been unable to add and it is visible from all the Macs.

  • Automator for Exporting Spotlight Comments?

    Hello,
    I have around 700 historic photos that have been digitized. All the photo details (dates, etc.) were entered into the Spotlight Comments field under Get Info. Unfortunately, none of the comments appear when I open the photos in Adobe Bridge CS4. Is there an easy solution (perhaps an Automator script) to export the Spotlight Comments and use them elsewhere?
    Thank you,
    Brian

    Brian
    If I read you right, what you are trying to do is grab Finder metadata and convert it to photo metadata. Specifically, convert spotlight comments to Exif and IPTC - which is what a Photo app will need.
    You can't do this with Automator. The Automator dictionary has ways to set Spotlight Comments but I can see no way to get them. Further the dictionary has the ability to write to the IPTC data only of images in Aperture, not in the Finder or iPhoto.
    You might do better with that question on the Automator forum here:
    http://discussions.apple.com/forum.jspa?forumID=1261
    Have you tried the Applescript that was suggested when you posted the query last?
    As your target are file managed by Bridge, give the Adobe forums a go too.
    However, you may run into another issue here and that is that most scanners (as I presume this is how the photos were digitised) do not create Exif and IPTC data for scanned images. It may not be possible to do what you want to do.
    Regards
    TD

  • Spotlight/Finder only searching "new" spotlight comments not old ones

    I have a bunch of files on my external hard drive that I had taken several hours to "tag" with spotlight comments a few months back. I tagged them so I could quickly find them in Finder or Spotlight by different key words and not just file names or their contents (folders wouldn't work because the keywords overlapped many of the files. Plus folders are slow). It worked beautifully. Until I stopped adding tags for those 4 months until now.
    I hadn't been using my comments at all in the past couple of months, but i had some files that I hadn't tagged so I decided to take the time to tag all the new ones. While testing to see if the comments worked, I noticed an extreme shortage of results, compared to the results i had for the same key words 4 months ago. I noticed that only the newly tagged files were showing up. I immediately checked the old files to see if the comments were still there and there they were. I restarted my MacBook Pro, thinking that maybe it was because I hadn't done so in the past few days. I noticed the little dot in the lens of they eyeglass and thought "oh boy! it'll reindex everything!" but it only indexed "new" files of course.
    So my question is: "*How did this happen?*" But more importantly: "*+How can I fix it?+*"
    I've thought that forcing spotlight to reindex my entire external hard drive would do the trick, but I cannot find any means to achieve that goal. Plus, I would rather just be able to index the files within one folder as I wouldn't have to wait an entire day of sluggish performance for that. Any ideas?

    Let me start with the "easy" question first: the .DS_Store files are where "Finder information" is stored. Windows users find these things a pain in neck, and usually insist they be deleted. Most of time this isn't a problem, the Mac users just get annoyed when their folder doesn't open the way it was when last closed--the principle information stored there is the view the folder was told to keep, the size of the icons and their arrangement, and so on. Every time you open a folder a .DS_Store file created if one does not already exist, and if one does the file will be updated if you change your settings for the folder, for instance switch it to List view, tell it to always open in List view, with columns for Date Modified, Size, but not Kind or Date Created. And it also keeps the information entered in Spotlight Comments. Just how Finder preserves this information if a file is moved, in Mac OS, to another folder, I don't know. But it does.
    What we REALLY need is a nice little program to write to the metadata of the file. For instance, Spotlight will index keywords, which are stored in the file itself, as part of the file's metadata. I mainly work with graphics, and Photoshop allows you to add keywords to the file's metadata. Apple's iPhoto and Aperture will also add keywords, but they are not written to a file's metadata until you export them. PDFs can also have keywords assigned, you can even do it with Preview. Text documents can also have keywords added using some (most?) text editors, including TextEdit (provided the file is in RTF format). The nice thing about keyword metadata is that it goes with the file, and be accessed in any OS that allows a metadata search.
    Unfortunately I don't know of any program that would allow you to select a batch of miscellaneous files and add the same keyword to all of them. It would certainly be handy though.
    Francine
    Francine
    Schwieder

  • Can't add/edit Spotlight Comments in Apple default apps

    I can't add text to the Spotlight Comments field (via Get Info) in Apple's apps installed by default. The computer just beeps when I try to type something. However, I have no such problem with 3rd party apps.
    Is this a bug or is there something I have to do to allow Spotlight Comments?
    The permissions on all Apple apps installed by Snow Leopard are "system: "Read & Write," "wheel: Read only," and "everyone: Read only."
    Thanks.
    Message was edited by: Gunny Sack

    Someone else noted that and I tried a few and couldn't edit them, even after giving myself write permissions. It might be tied to some form of code signing/protection.

  • Collections in finder, quick add to spotlight comments

    I'm wanting to optimize the way I'm using spotlight, and know that there's a field for spotlight comments when you select and item in finder and command-i... I'm wondering if there's a keyboard shortcut that can let me add spotlight comments directly, or is there a Quicksilver plug-in that might let me do that?
    Also, within spotlight is there a way to configure it so that the first (or only) items to come up are the ones that I've added the relevant spotlight comments to?
    Basically what I'm wanting to do is to add the metadata that would effectively make collections like in Yojimbo or Notemind... I love Yojimbo's idea, but I don't want a separate database for all my yojimbo collections... I don't want to be bound to Yojimbo and don't want it always running in the background... the finder is already a fabulous database, and between QS and spotlight you can do a million more things than Yojimbo can let me do... so I would love to get this "collections" effect inside finder without making a million aliases for my files...
    Any suggestions?

    Let me start with the "easy" question first: the .DS_Store files are where "Finder information" is stored. Windows users find these things a pain in neck, and usually insist they be deleted. Most of time this isn't a problem, the Mac users just get annoyed when their folder doesn't open the way it was when last closed--the principle information stored there is the view the folder was told to keep, the size of the icons and their arrangement, and so on. Every time you open a folder a .DS_Store file created if one does not already exist, and if one does the file will be updated if you change your settings for the folder, for instance switch it to List view, tell it to always open in List view, with columns for Date Modified, Size, but not Kind or Date Created. And it also keeps the information entered in Spotlight Comments. Just how Finder preserves this information if a file is moved, in Mac OS, to another folder, I don't know. But it does.
    What we REALLY need is a nice little program to write to the metadata of the file. For instance, Spotlight will index keywords, which are stored in the file itself, as part of the file's metadata. I mainly work with graphics, and Photoshop allows you to add keywords to the file's metadata. Apple's iPhoto and Aperture will also add keywords, but they are not written to a file's metadata until you export them. PDFs can also have keywords assigned, you can even do it with Preview. Text documents can also have keywords added using some (most?) text editors, including TextEdit (provided the file is in RTF format). The nice thing about keyword metadata is that it goes with the file, and be accessed in any OS that allows a metadata search.
    Unfortunately I don't know of any program that would allow you to select a batch of miscellaneous files and add the same keyword to all of them. It would certainly be handy though.
    Francine
    Francine
    Schwieder

  • Import spotlight comments?

    Is there a way to import spotlight comments along with the photo into iPhoto? And vice-versa, is there a way to export the photo description into spotlight comments?
    I'm guessing no. I don't see a anything in preferences or the import/export command, but I thought I would ask to be sure!
    Thanks,
    Karen

    Karen
    Is there a way to import spotlight comments along with the photo into iPhoto?
    No, unless you can find a way to write that to the Exif data.
    And vice-versa, is there a way to export the photo description into spotlight comments?
    No, you can only use the Title and Keywords.
    However this app
    http://www.tc.umn.edu/~erick205/Projects/Metadata%20Export/
    may be useful to get the info out and you can copy and paste.
    Regards
    TD

  • Spotlight's blind spot: Spotlight comments on Disk Utility disk images.

    Has anyone but me noticed that Spotlight goes blind to Spotlight Comments once the files are moved into a 256-bit encrypted read/write disck image created with Disk Utility? I don't have iPhoto, and I keep photos in too many categories for that anyway. I keep all my keywords in Spotlight comments in Finder attached to each file and create "albums" on the fly with Spotlight searches.
    But as soon as I moved the whole mess into a read/write 256-bit encrypted disk image created with "from folder" in Disk Utility....I can still see all the comments in Finder GetInfo, but Spotlight can't. I even tried adding comments to the search field list and it still sees nothing, not even when the disk image is mounted and visible in my Finder window sidebar.
    What am I missing?

    Yes, I search while the drive is mounted.
    Yes, I can drag it into and out of Spotlight's Privacy Pref's Pane. While it's in there the entire drive obviously disappears from Spotlight's searches. Once I - it from the exclude list it returns to seeing folder names only, but still finds nothing based on Spotlight Comments.
    I'm starting to think Apple left that bit of code out. Anybody know how to put it back in?

  • Spotlight comments not found - possible fix

    I'm having problems with spotlight comments not being indexed on some files.
    The tip from djhartman http://discussions.apple.com/thread.jspa?threadID=1215039&tstart=0 fixed this:-
    To remove ALL ACLs from your homedir, use:
    chmod -R -N ~
    Thanks a lot. The missing files soon after running the command appeared in the smart folder. I migrated from Tiger to Leopard and I have had various issues which I've only recently discovered is due to changes in how Mac OS X now handles access. Hopefully this command has done the job.
    I also had some folders and files which were either missing the staff group or had permission problems. I used the following commands to fix this. 755 gives the current user read, write and execute access and gives the group the current user belongs to (probably staff or admin) read and execute access and everyone gets read and execute access. I only used these commands in folders containing my documents not in my ~Library or anywhere else that contains system files.
    How to change folders or files to default user, group and permissions
    Open terminal:
    for folders use
    chmod -R 755 (drag and drop folder here) [press enter]
    (-R switch = recursively applies to all sub-folders and sub-files)
    for files use
    chmod 755 (drag and drop file here) [press enter]

    Running the password reset actually recreated the problem but that's ok because it helped lead me to the true cause and answer. Being a member of the wrong group can cause all sorts of annoying problems e.g. asking for authentication when deleting files, spotlight not indexing some files etc. Luckily this post http://www.macosxhints.com/article.php?story=200711291134001 had the answer. I'll sum it up here:
    I had a problem with spotlight not indexing some files especially spotlight comments. I'd tried deleting spotlight-V100 to re-index and many other things which did not work when all along it was a group membership problem.
    I had upgraded from Tiger to Leopard. The GUI tools in Leopard showed my primary group was staff and nothing looked wrong until I discovered the Unix commands thanks to your great script. I didn't run the script but it was very well commented so I knew what the commands did if I ran them in terminal.
    dscl . read /Groups/staff
    showed I wasn't in the group staff. (even though system preferences>accounts>advanced options said i was!)
    sudo dscl . append /Groups/staff GroupMembership $USER
    added me to group staff.
    sudo chgrp -R staff $HOME
    changes group ownership on all files in home to staff.
    sudo diskutil repairPermissions /
    repair disk permissions.
    Reboot.

  • Spotlight comments lost, spotlight comments lost

    Hi,
    my Spotlights comments will be lost.
    Day by Day it will be more and more.
    For what is the Spotlight comments when dont do write on them.
    I will be use it for  Tags to building as Datastructure.
    Thanks for help.
    Michael

    This is strange indeed.
    I just checked whether it worked for me by dragging my avatar here to the desktop and going to Get Info. The URL was included in the info.
    I have checked the options in Preferences, and the additional options in, for example Onyx, and there doesn't seem to be anything about that, that could have been accidentally activated.
    For the moment I am out of ideas, but I will keep thinking!

  • Spotlight comments - max length?

    Is there a maximum number of characters that can be in a Spotlight comment entered in a Get Info window, or perhaps are there forbidden characters?
    I have a bunch of images that I've downloaded and pasted a description into the Spotlight comments. Now it's been several days and when I tried a search that yielded no results I realized that the Spotlight comments for these files are now empty.
    A search here yielded a similar problem where comments disappeared and the solution offered was to run in Terminal "mdimport -n (FILENAME)". This did nothing for our missing comments.
    Can anyone suggest what my be going on and hopefully a reasonable solution?
    Message was edited by: Notary Sojak

    Hello,
    Check this out: Organize files with Spotlight comments
    And here: http://www.russellbeattie.com/notebook/1008443.html
    Carolyn

  • Spotlight comments search

    I have a customer that upgraded to 10.5 server for the spotlight comments searching on share points. They can search everything else but the comments. We have tried setting up a group with all the users having full read/write permissions. I have reindexed the share points. I can search the comments from the xserve that the raid is attached to. Just not on any of the networked computers. The networked computers are all PowerMac G5s running Tiger. I have heard that having a space in the share point can cause problems and some of the share points have space but not all and they can't search the comments on any of the share points. We have tried searching files on the root directory as well as in folders on the share points. Has anyone else had this problem or have a suggestion?
    Thanks

    Hi TD
    Yes and no.
    Yes it worked the way you mentioned but if I change the Spotlight Comment: on the same file to something else I can still find it via 'Fruit'. I much prefer command-space bar to call Spotlight.
    How long does it take a change to a Spotlight Comment: to filter into Spotlight?
    Its not the end of the world its just I was finding Spotlight really useful until I came up against this.

Maybe you are looking for

  • Query structure problem (i think)

    hi am trying to get selected strings out of a jlist and concanate them into a query i dont have any problems getting the strings out of the list and into the query ,i think that my problem lies within the structure of my query.i am trying to create a

  • Need to add a custom field in ME23N  item detail

    Hi Experts, I am new to SAP. Got an issue to add custom field in ME23N transaction. In item detail part , there is a tab called Retail inside that tab i need to add  new field.. is it possible to do?? if so kindly let me know.. Thanks in advance Rega

  • Auto nesting objects

    Is there some way (script / plugin?) to auto nest objects on page? In other words, to place all objects as tight as possible to eachother.

  • Will this ViewSonic LCD Monitor work w/G4 MDD?

    I don't know enough about screen resolution to know whether this particular ViewSonic LCD monitor will work with my G4 MDD. The G4's video card has an ADC connector and a DVI connector. The monitor I'd like to get, which uses a DVI cable, is the View

  • Renaming Music Files

    How does one rename a music file on a mac? In a folder, can I click to let the artist, album, track info show up? On a PC, one could edit the tags and rename a music file by right click > properties and also sort the files by album info, artist name,