Smart Folder Based On Spotlight Comments

I'm trying to set up a smart folder to contain all files that I've made a given Spotlight comment for. When I start to set up a New Smart Folder and choose the Comment drop down and input the comment that I've tagged several files with (by using Command-I on the given files) it doesn't seem to take. Is this supposed to work? If not, what does the "Comment" drop down list item refer to in the New Smart Folder dialogue? Thanks for any clues about this.

Unfortunately this seems yet another case where one set of programmers in the Spotlight project were not talking to another set of programmers. When I selected "Comment:Contains http" I got one hit, which had nothing whatsoever to do with the many files I have that have their source URL in the Spotlight Comment field. I quickly discovered that it was because Comment actually issues this query:
(kMDItemComment = 'http*'cd) && (kMDItemContentType != com.apple.mail.emlx) && (kMDItemContentType != public.vcard)
When I used a metadata reader to examine one of my files that had the URL in the Spotlight Comment field I discovered that the comment is actually entered in this metadata field:
kMDItemFinderComment = "http://image.versiontracker.com"
So the metadata programmers have the tag as "kMDItemFinderComment" while the programmers for the search criteria assumed it was "kMDItemComment"--so the search won't work.
What I did was select Raw Query, and then entered this:
kMDItemFinderComment = "http://*"
The asterisk * is a wild card standing for "anything at all following http://"--this promptly found 23 files in my current Downloads folder. Using this as the Raw Query and selecting Computer to search:
kMDItemFinderComment = width*
Immediately found 7, 665 images on my three internal drives that have their dimensions given in the Comment box.
Francine
Francine
Schwieder
PS--I just sent this to Tiger Feedback.

Similar Messages

  • How do I finish this Create Smart Folder script?

    I've gotten most of the way on a homemade file tagging system. My Automator Service gets files, asks what to tag them, applies the tags to the Spotlight Comments, and then asks if you want to make a Smart Folder that finds one of your new tags.
    If you do, it runs a script. The script asks what tags you would like to populate the Smart Folder, initiates a new smart folder based by appending the tags to "comment:" in the Spotlight search. But that's where I'm stuck. I can't figure out how to automate clicking the darn "Save" button to create the Smart Folder.
    And feel free to co-opt my tagging strategy, it is working famously for a team of 5 in shared Dropbox folders.
    Here's my Applescript. See the solitary comment in my code below for where I think I need help.
    ====================
    display dialog "Which tags should be queried to populate the Tag Folder?" default answer "separate tags by spaces" buttons {"Cancel", "Continue"} default button 2
    if (button returned of result) is "Continue" then
    set the clipboard to "comment:" & text returned of the result
    tell application "Finder" to activate
    tell application "System Events" to tell process "Finder"
    keystroke "n" using {command down, option down}
    keystroke "v" using command down
    end tell
    tell application "Finder"
    display dialog "What shall we name the Tag Folder?" default answer "" buttons {"Cancel", "OK"} default button 2
    if (button returned of result) is "OK" then
    set the clipboard to text returned of the result
    tell application "Finder" to activate
    tell application "System Events" to tell process "Finder"
    # How do I tell Finder to click that Save button?
    delay 0.5
    keystroke "v" using command down
    delay 0.5
    key code 36
    end tell
    end if
    end tell
    end if
    =================
    Message was edited by: kerryspyder

    My pleasure. Thanks for the star.
    And here's a bonus that might some day prove useful:
    *            key code 36*
    *            if sheet 1 of sheet 1 of window 1 exists then*
    *               click button "Replace" of sheet 1 of sheet 1 of window 1*
    *            end if*
    *         end tell*
    Message was edited by: Pierre L.

  • 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?

  • Excluding items in a given folder from a Smart Folder Search

    Hi: Looking for a tip here. I would like to exclude what pops up in a smart folder based on what folder it is. I do NOT want to exclude that folder from my general spotlight search ability, just in that smart folder.
    Reason asking: I have a folder in docs that I use everyday, and backup (with a 3rd party utility) to my iDisk folder. This way I have backups on my home computer at virtually all times. (iDisk is good for backups, Dropbox for 'sharing') I have a smart folder that displays all the stuff that i've worked on in the last day. I've used a lot of 'not' tricks to exclude all but the file types I use, but I always get a double copy in that folder. The one in my working folder and the one on my iDisk. What would be perfect is to simply say exclude what is found at the iDisk location, but that doesn't seem to be an option in the search criteria. I could exclude the while iDisk from spotlight in general, but I still want to be able to find things when I type them on the standard search.
    Any thoughts?

    thanks, Michel. it had occurred to me to put a scratch tag on the folder, but I was hoping for an easier way. in future I'll do as you suggest though, because it's easier than what I have been doing.
    daryl

  • Spotlight comments search  and smart folder fails

    Spotlight search of the "Spotlight Comments" field fails after a file is saved in TextEdit or iWork programs.
    I reproduced this failure, 100% of the time, in OS X 10.8 and 10.8.1 (with iCloud enabled or with it iCloud disabled) and can not reproduce this failure in Mac OS X 10.7.x
    The steps to reproduce are simple and quick:
    Create a new test file in TextEdit and Save it on the Mac (saved as, for example, test.rtf)
    Quit TextEdit
    In the Get Info panel for the test.rtf file and enter some unique text in the Spotlight Comments: field, for example XYZZY:
    In Finder create a new Smart Folder (File > New Smart Folder)
    Create a search criteria in the Spotlight comment field for the unique text from step 3 (XYZZY in this example) and hit Save and name the Smart FolderNote, the test.rtf file immediately appears in the smart folder
    Open the test.rtf with TextEdit and change the text and Save the file.
    Note, as soon as you hit Save in TextEdit the test.rtf file disapears from the SmartFolder.  This is the error.  Also note, the Spotlight Comment value (in this example, the text XYZZY) is unchanged, it still exists.
    See attached screen shot after step 7 that shows the smart folder no longer shows the text.rtf file even though the search criteria is met.
    I have reproduced this error with TextEdit and Pages and Numbers but not with other applications that are not iCloud enabled.

    Clendenen02 wrote:
    where should I run the code? in the terminal, or an applescript, or should put it in xcode and run it from there or the terminal.
    What MrHoffman said.
    But if it's easier, you can wrap it in Automator and have Automator ask for the Folders: (Test on a sample of your files before running on all 700 files)
    (do you really own 700 movies??)
    The Workflow is:
    Put this in the Run Shell Script Action (and pass input as arguments":
    PicDir=$1
    MovDir=$2
    for f in $PicDir/*
    do
         if [ ! -d "$f" -a "${f##*.}" = "jpeg" ]; then
              comment=$(mdls -raw -name kMDItemFinderComment "$f")
              if [[ $comment != "(null)" ]]; then
                   picname=${f##*/}
                   movname=${picname%.*}.m4v
                   if [[ -e "$MovDir"/$movname ]]; then
    osascript <<-EOF
    tell application "Finder"
    set comment of file (POSIX file "$MovDir/$movname") to  "$comment"
    end tell
    EOF
                   fi
              fi
         fi
    done
    (BTW, I know that this is a bit of sloppy scripting (wraping an osascript in a Bash Script wrapped in Automator, but it does what you need)

  • Smart Folders, Spotlight comments and Apple mail messages

    Hi,
    I have a simple question, but couldn't figure it out yet:
    I have a workflow that tags specific mail messages according to the specific mail inbox folders I assign them to (be it via incoming rules, or Act-On rules) by automatically adding specific Spotlight comments.
    My mail messages, therefore, have text in their comment boxes (if you check via GetInfo).
    When I use Spotlight, I can find mail messages by searching for the comments - this is exactly as expected.
    I however also have smart folders (searching for a specific Spotlight comment) that list other files that I tag with the same Spotlight comments - but my Smart Folders never find the mail messages with the requested tags (at most they find the folder that contains the messages if this folder is tagged - which it is generally not).
    Question: how can I make sure that the Smart Folder does indeed identify and list the mail messages that I have tagged via Spotlight comment ?
    Thanks a lot !
    D.V.
    iBook G4   Mac OS X (10.4.6)  

    Howdy,
    I cannot reproduce this problem myself...I see the same results in both the Mail spotlight and the spotlight menu bar item. I'm not sure if after installing 10.5 a new spotlight index is created, but it might be worth a shot to create a fresh index and see if that helps.
    I haven't tried this, but it was the easy way I could find to reindex.
    Open Spotlight Preferences
    In the privacy tab, add the volume you want to reindex
    After a few moments, remove that volume from the privacy list
    Allow Spotlight to reindex the volume
    Please let me know if that works for reindexing.
    +R

  • Smart folder search with "comments" does not work

    I am using Lion (OS 10.7.5), and am unable to define a Smart Folder in which the search criteria is a particular Comment in "Get Info". Nothing appears in the folder. In System Preferences, Spotlight lists under "Search Results" 15 different categories, but "Comments" is not one of them.

    Hi,
    I haven't tried this, but the auth part is mainly added to support credentials for OpenSearch result sources. It might work for SP as well, but you have to make sure you have enabled basic auth on the web app. Have you done that?
    Thanks,
    Mikael Svenson
    Search Enthusiast - SharePoint MVP/MCT/MCPD - If you find an answer useful, please up-vote it.
    http://techmikael.blogspot.com/
    Author of Working with FAST Search Server 2010 for SharePoint

  • Smart Folder with "Comment" as search criteria doesn't work

    I am using Lion (OS 10.7.5), and am unable to define a Smart Folder in which the search criteria is a particular Comment in "Get Info". Nothing appears in the folder. In System Preferences, Spotlight lists under "Search Results" 15 different categories, but "Comments" is not one of them.
    Any advice on why this doesn not work?

    Dear Peter,
    I met the following problem, and please help me.
    My English (not Chinese) operating system: Windows XP
    Version: 2002
    Before using RoboHelp 7 to generate Webhelp, I perform the
    following steps:
    1. Control Panel->Regional Options
    2. On the "Languages" page make sure make sure you check the
    box "Install files for East Asian languages".
    3. On the "Advanced" page select "Chinese" from the language
    dropdown list.
    Then I perform the following steps:
    1. Use RoboHelp 7 to generate Webhelp (my Webhelp project
    contains localized Chinese files).
    2. In the "Search" tab, input a Chinese character(For example
    "连接") and perform a seach.
    Result: Serching...(or 正在搜索) or
    No topics found (or
    未找到主题)。
    Expected result: I can get the result.
    Text

  • How to copy a files spotlight comments for an entire folder and place them in a different file with that same name

    I have the same question in a different discussion but I already marked it as solved because one of the questions was answered. Here's the linke to the other discussion if your interested https://discussions.apple.com/thread/5970421 
    I have movie covers saved as a jpeg for every movie my family and I own. There is about 700 and they each have a comment of the main actors, release dates, and descriptions. This makes it easy to find what to watch.Is there an applescript, automator, program I can download,  or program code supported in xcode that will do the following set of inscructions?
    Take the name of the picture file and spotlight comment, copy and paste it to a movie file's comments to a file with the same name but obviously has different extention. For an example
    In a Pictures folder
    Name: Dark Knight, The.jpeg       Comment: (2008) Genre: Action...             <- copy comment
    In a Movie Folder
    Name: Dark Knight, The.m4v       Comment:                                               <- paste
    and do this for all 700 files

    Clendenen02 wrote:
    where should I run the code? in the terminal, or an applescript, or should put it in xcode and run it from there or the terminal.
    What MrHoffman said.
    But if it's easier, you can wrap it in Automator and have Automator ask for the Folders: (Test on a sample of your files before running on all 700 files)
    (do you really own 700 movies??)
    The Workflow is:
    Put this in the Run Shell Script Action (and pass input as arguments":
    PicDir=$1
    MovDir=$2
    for f in $PicDir/*
    do
         if [ ! -d "$f" -a "${f##*.}" = "jpeg" ]; then
              comment=$(mdls -raw -name kMDItemFinderComment "$f")
              if [[ $comment != "(null)" ]]; then
                   picname=${f##*/}
                   movname=${picname%.*}.m4v
                   if [[ -e "$MovDir"/$movname ]]; then
    osascript <<-EOF
    tell application "Finder"
    set comment of file (POSIX file "$MovDir/$movname") to  "$comment"
    end tell
    EOF
                   fi
              fi
         fi
    done
    (BTW, I know that this is a bit of sloppy scripting (wraping an osascript in a Bash Script wrapped in Automator, but it does what you need)

  • How to copy a files name and spotlight comments to a text file for an entire folder

    I have movie covers saved as a jpeg for every movie my family and I own. There is about 700 and they each have a comment of the main actors, release dates, and descriptions. This makes it easy to find what to watch. I want my parents to have all of this info but they have a windows laptop so the comments don't transfer with the file and can't be searched like you can on a mac. Is there an applescript, automator, program I can download,  or program code supported in xcode that will do at least one of the following things?
    1)Take the name of the picture file and spotlight comment, copy and paste it into a text document like word that looks like this...
    File Name1- Spotlight Comment for file 1
    File Name 2- Spotlight Comment for file 2
    . for all 700 files in a folder
    2) It would be equally helpful if there was something that would take the name of the picture file and spotlight comment, copy and paste it to a movie file's comments with the same name but obviously has different extention. For an example
    In a Pictures folder
    Name: Dark Knight, The.jpeg       Comment: (2008) Genre: Action...             <- copy comment
    In a Movie Folder
    Name: Dark Knight, The.m4v       Comment:                                               <- paste 
    and do this for all 700 files
    3) Is there a free photo program that works on mac and windows that I can put all my movie pictures in and have a description like I did with the comments? It would also need a place that to search the description for keywords. So Basically an itunes for pictures that works on both mac and windows. If so I still need a way to get the spotlight comments to the description.
    4) I feel like this would make things more difficult, but if not I can put all of the .m4v files in itunes so instead of pasting all the comments back into a file in finder paste them in a description in itunes
    5) At the very least a code that I can run one by one for every file that will paste the comments into the same document
    Note: When I say spotlight comments I mean the comment box that is available when you click on get info of a file. The pictures are in the pictures section of finder in a folder called Movie Pictures. The movie files are on an external hard-drive in a file called Movies. Also I am slightly familiar with applescript and automater in that I have used both to create keyboard shortcuts and simple voice commands. I have programmed in c++ and C too. So If you give me a code for applescript I do know what to do with it.
    Thanks to anyone who takes the time to read all of this and extra thanks to anyone who tries to help.

    Clendenen02 wrote:
    2) It would be equally helpful if there was something that would take the name of the picture file and spotlight comment, copy and paste it to a movie file's comments with the same name but obviously has different extention. For an example
    In a Pictures folder
    Name: Dark Knight, The.jpeg       Comment: (2008) Genre: Action...             <- copy comment
    In a Movie Folder
    Name: Dark Knight, The.m4v       Comment:                                               <- paste 
    and do this for all 700 files
    This Bash script will do it.
    Edit "PicDir" and "MovDir" to the location of your Folders
    (Note: The comment is written to the m4v file using xattr, so the Spotlight comment field appears blank in Finder, but the comment metadata is still indexed by Spotlight (If you add a Spotlight comment from Finder, it is stored both as an extended attribute and in a .DS_Store file)
    #!/bin/bash
    PicDir=$HOME/Desktop/Pictures
    MovDir=$HOME/Desktop/Movies
    for f in $PicDir/*
    do
         if [ ! -d "$f" -a "${f##*.}" == "jpeg" ]; then
              comment=$(mdls -raw -name kMDItemFinderComment "$f")
              if [[ $comment != "(null)" ]]; then
                   picname=${f##*/}
                   movname=${picname%.*}.m4v
                   if [ -e "$MovDir"/$movname ]; then
                         xattr -w com.apple.metadata:kMDItemFinderComment "\"$comment\"" "$MovDir"/$movname
                   fi
              fi
         fi
    done

  • Spotlight Comment Missing, But Smart Folders Still Work

    I have entered a lot of spotlight comments on files. On about several 100 off them, Apple Command i does not show any spotlight comments. Its not likely that I erased or failed to "save" several 100, say about 600 out of 900 files. I know for a fact that I entered spotlight comments on nearly all of my photo files. For some reason, the smart folders that look for spotlight comments still return the files.
    I shut down and rebooted. Still no change. For some reason, I cannot find the way to edit the search criteria in smart folders.
    Any ideas?

    Well, this is proving to be a tough case. I rebooted with Option, Command P and R, and then rebooted in safe mode and ran disk utility, both verify permissions and check volume on both the upper level drive (the one that has a technical name) and the named volume (the one that has a user-assigned name). I hate to say this, but nothing has changed. <darn>.
    I am kind of thinking about paying Apple to furnish and install an upgrade to my OS from 10.4 to 10.6 but am reluctant because of persistent reports that the newer OS has driver problems with Epson photo printers, and other issues with Adobe LightRoom which is a critical app for me.
    I did search the forum to see if anybody else has the same kind of problem but did not find anything. It generous of you to offer your expertise, so I hate to keep coming back.
    Anyway, is there another approach that I could look into?
    Thanks!

  • Automator Folder Action: File Name = Spotlight Comment?

    Hey guys,
    I'm trying to have automator add the original filename of a file as spotlight comment when it is added to a certain folder. I can only use the "Set Spotlight Comments for Finder Items" in folder actions to add a specified comment, but nothing else. Is it possible to grab the file name via applescript?
    The idea behind this is to preserve the original file names of all downloaded files before they get renamed.
    Thanks,
    V

    Thanks for your reply, I now have your action installed and it does get the filenames, but I still can't add them to the spotlight comment text box. Looks like I didn't think this through properly.

  • Creating a smart folder with Terminal?

    What I'm trying to do might not be possible, which wouldn't surprise me at all. What I'd like to do is one of the following:
    1. Create a smart folder that contains everything in the "/" folder.
    2. Create a smart folder that is populated with every volume currently mounted on my Mac.
    Essentially what I'm hoping to do is create a smart folder I can then use as a stack that would contain all the volumes currently located on my Mac. The only solution I've found so far for this is to use the /Volumes/ folder but this doesn't suit my needs as occasionally I get double icons for drives (1 being the alias the second being a private folder). Also it fails aesthetically which is part of the reason I'm doing this in the first place.
    If anyone could recommend a solution that'd be great. I figured Terminal was my best bet, unfortunately my knowledge of this form of coding is non-existent and no amount of Google searches could help me.

    I don't see how either item on your wish list can be satisfied by any of this "smart" stuff. The smart searches/folders are based on queries against the same metadata used by Spotlight - and that doesn't even look at / or /Volumes. Even if the info were available, is it up-to-the-minute enough to really be usable?
    If you want to examine the built-in searches as a guide, you'll find them in:
    /System/Library/CoreServices/Finder.app/Contents/Resources/CannedSearches
    Note that each of the items therein is a package, so you'll have to drill a bit deeper to get to the query file. I found that Property List Editor from XTools was a good way to get a structured view of them.

  • GET spotlight comments automator?

    I have written an automator, based on a suggestion found at this site, that appends comments to the spotlight comments. I can even delete existing comments. But, what I don't seem to be able to do is to GET EXISTING comments and make a change to these existing comments - add additional comments, if necessary - and enter then new comments back into spotlight comments.
    Does anyone have any ideas?
    Thanks.
    Matt

    Save the code presented below as an application.
    Launch (run) the application to select a file for 'comment' processing; or, drag items onto the applet for each items' 'comment' field to be processed.
    --- Code starts here ---
    on open (ditems)
    repeat with i in ditems -- Cycle through list of dragged items.
    my handle_Item(i) -- Process each item.
    end repeat
    end open
    on run
    my handle_Item(choose file without invisibles) -- Select file to process.
    end run
    on handle_Item(tItem)
    tell application "Finder" to set (comment of tItem) to (text returned) of (display dialog (tItem as string) with title "Spotlight Comment: " default answer (comment of tItem) as string) -- Display and accept modification of 'comment' field contents.
    end handle_Item
    --- Code ends here ---
    To process a file or folder via launching the applet ...
    --- Code starts here ---
    on open (ditems)
    repeat with i in ditems -- Cycle through list of dragged items.
    my handle_Item(i) -- Process each item.
    end repeat
    end open
    on run
    if (((button returned) of (display dialog "Make a selection:" buttons {"Cancel", "File", "Folder"} default button 2)) is "File") then
    my handle_Item(choose file without invisibles) -- Select file to process.
    else
    my handle_Item(choose folder) -- Select folder to process.
    end if
    end run
    on handle_Item(tItem)
    tell application "Finder" to set (comment of tItem) to (text returned) of (display dialog (tItem as string) with title "Spotlight Comment: " default answer (comment of tItem) as string) -- Display and accept modification of 'comment' field contents.
    end handle_Item
    --- Code ends here ---

  • Spotlight Comments not found

    I added "backup" as a Spotlight Comment to a variety of files and folders using an automator action. When I search using the query Spotlight Comment contains "backup" only a few of my files and folders with that comment are found. I have tried re-indexing but still Spotlight misses some files and folders. Spotlight in Tiger would find all of them. I believe in Leopard Spotlight Comments are now written in extended attributes. Can someone please try adding a Spotlight Comment to some files/folders and see if they are all found in a spotlight search. Thanks.

    biovizier wrote:
    ..."I will say that Leopard seems a lot better at keeping track of comments than Tiger was but it probably wouldn't hurt to be mindful of how files are transferred to make sure the .DS_Store file goes with it. I personally would not rely on "Comments" for anything important.
    Hmmm. It says in Leopard Help: +To make items easier to find when you search for them, you can use the Spotlight Comments field in the Get Info dialog. For example, use the field to mark all the files for a project with the project name or tag all your urgent files with the word “urgent".+
    So, Apple are saying that it certainly should work - it is called 'Spotlight Comments' after all! What I've found though is that it's unreliable. I'm trying to reorganise all my filing around metadata - having just a few 'physical' folders and using a metadata+ Smart Folder combination to do the rest. To do this requires using the Spotlight Comments field (which can be accessed via a Finder search by using 'Other ...' from the Finder's searching popup menu. So, I having been using my own 'keywords' in the Comments field, but the problem is that sometimes Spotlight finds them and sometimes not. I can have the keyword in 6 files and spotlight will find 4 of them, sometimes all of them. I've re-edited and rearranged but cannot get consistent results.
    Has anyone had a similar experience and found any pattern to what works and what doesn't?

Maybe you are looking for