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

Similar Messages

  • Ho to get file name and full path of a local file

    I want to be able to get the file name and it's full path of
    a local file. I was thinking of using "FileReference" but
    FileReference doesn't permint accessing the local file path. Can
    anyone suggest a way of doing this.
    Thanks

    You will have to create 2 different versions.
    See this example we have created using JSystem
    http://jsystem.flashjester.com
    Download the example file provided.
    Hope this helps.
    Regards
    FlashJester Support Team
    e. - [email protected]
    w. - www.flashjester.com
    "This has been one of the most impressive and thoroughly
    pleasant
    experiences of customer support I have ever come across -
    astounding!"
    Director - hedgeapple

  • How to get file name and set it as static text in a dialog

    Hi,
    I m new to InDesign Programming.
    I have a menu that creates a dialog with different controls in it.
    The dialog will appear only if there is an open file. I need to display the name of the open file as a static text in the dialog. I know to get the name of the current file but don't know how to pass this each time the dialog is opened.
    Can someone help me in doing this?
    I m using InDesign CS3 in MAC OS.
    Thank You.

    those are the methods, but you can't use getCharacterEncoding(), actually, cuz it seems it's not necessarily filled in.. or at least that might be on some servers only, like Tomcat 4. As for encodings, you need to do a search for character encoding names and use the appropriate one.

  • Powershell script - how to read a registry hive and store the value in text file and then again read the text file to write the values back in registry

    Hi All,
    powershell script Method required to read a value from registry and then taking the backup of that values in some text file.
    For example the hive is
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\Path
    and under path i need to take back up  of values in some text file and then put some value in the registry after back is taken in text file.
    Also how to read the text file values so that we can again write to registry hive  back from the back up text file.
    Your help is much appreciated.
    Umeed4u

    I think you need to read this first:
    http://social.technet.microsoft.com/Forums/scriptcenter/en-US/a0def745-4831-4de0-a040-63b63e7be7ae/posting-guidelines?forum=ITCG
    Don't retire TechNet! -
    (Don't give up yet - 12,830+ strong and growing)

  • How do I change the name and cover of a ebook in ibooks for mac?

    I have iBooks on my macbook pro and would like to change the name and cover of some epub books I dowloaded.  How do I go about doing this, if there a get info like in itunes that I just can't find?

    Try Calibre for Mac, available on macupdate.com. It's clunky to have to use 3rd party software, but until Apple fixes the abomination that is iBooks, that's what we'll have to do.

  • File name to be generated from outbound text file data

    Hi Experts,
    I am collecting IDOCs and generating  IDOC-XML(for IDOCS) file and sending it to PI 7.0 using sender file adapter.
    This is File to File scenario.
    IDOC-XML file picked by sender file adapter gets transformed using XSL mapping in to .dat(text) file.
    Sample Output of .dat file (target file)
    STR SE 2008-10-3011:13:00$SEQ
    EIH21148862                        D2008102820081127SEK000000894800000000894800000000000000 0000XYZ co Ltd                KL25533781          2114886209                    335592                        2508867                      
    EIL21148862                                   0000000000000000100000000000020081021  335592   20081010KILLL899       Operating System
    Now I want output file name to be: ABC_DEF_cc_yyyymmdd_segno.dat
    ABC_DEF is constant
    cc - means country code, in this case it should be "SE", which is marked in bold immediately after STR.
    yyyymmdd - date format
    segno - which means no of records like number of lines in text file, (say three records: STR, EIH, EIL)
    Please feel free for any clarifications required.
    I hope I am able to explain scenario.
    I would really appreciate if you can help me with your valuable inouts.
    Thanks,
    Divyesh

    hi,
    just put one more mapping as the last mapping in your interface mapping
    it can be abap or java mapping
    then as per this blog fill out Filename attribute which will set the file name
    /people/william.li/blog/2006/04/18/dynamic-configuration-of-some-communication-channel-parameters-using-message-mapping
    you can parse the whole IDOC structure in tthose mappings to get all the data you need for the filename
    this is the easiest way I'd say
    Regards,
    Michal Krawczyk

  • How to strip a file name and add it to array

    Hello I am new to labview, and I need to know how to strip a file name and add it to an array. For example, filename joe.csv, then take "joe" and add it to an array with other inputs. A visual depiction will be very helpful
    Attachments:
    channel read and error check R03_v9(JHK).vi ‏101 KB

    What does your code attachment have to do with your question?
    What are "other inputs"?
    I assume you have an array of strings. You can strip the filename using get file extension. You can build an array using build array. Wire the existing array on one input ant the string as a second input.
    LabVIEW Champion . Do more with less code and in less time .

  • Adding file name and file full path to a page

    Hi all I'm new to scripting
    What I want to do and don't know how to go about it is to run a script that collects the saved file name
    and the full path where the file is saved on the network and displays it on my document
    If any one has done something similar or if some one can help me create it it would be appreciated
    Thanks Gabriel

    var idoc = app.activeDocument;
    var itext = idoc.textFrames.add();
    var file = idoc.fullName;
    itext.contents = file.fsName;

  • Display file name and remove error from log output

      This script is working great from the GUI but when I call it from a cmd file from a job scheduler it throws out errors. I also want to display from is location the file name and it's byte count(ForEach($File in $Files)) so I can tell if any of the
    files being combined where actually empty. It wants to search the current location from the sever not just-Locations parm..
    Error message in LOG file:
    Get-ChildItem : Cannot find path 'F:\powershell\-SearchFor' because it does not
     exist.
    It's trying to find file install.cmd from where script starts and all the -Locations(which is only the search parm)
    Function Search-Files{
    Param([String[]]$Locations, $SearchFor, $AppendTo)
    Begin
    If(-Not (Test-Path $AppendTo)){New-Item $AppendTo -ItemType File -Force}
    Process
    ForEach($Location in $Locations)
    $Files = Get-ChildItem -Path $Location -Filter $SearchFor -Recurse
    ForEach($File in $Files)
    Get-Content -Path $FIles.FullName | Out-File $AppendTo -Append
    End{}
    Search-Files -Locations "\\Server1\c$\Temp", "\\Server1\c$\Test1" -SearchFor "Install.cmd" -AppendTo "C:\Temp\Search.log"
    Thanks.

     I search multiple shares to find a common file name then create a single output file. I will be doing this search and file creation
    for 5-10 different file names. If there is a better way .. certainly open for suggestions. It's working but having issue with
    the cmd file for every file and folder I check. It puts this error out for each run of the process.
      Error message in LOG file:
    Get-ChildItem : Cannot find path 'F:\powershell\-SearchFor' because it does not exist.
     Thanks.
    I tried your code with little changes and saved in Temp folder.
    My CMD file has the below code
    PowerShell C:\Temp\Untitled1.ps1
    It worked.
    Regards Chen V [MCTS SharePoint 2010]

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

  • Copy file name and info from finder window

    I need to get the file name and file size for lots of files in lots of folders into a text file or excel file. I have found the way to copy the file path into text edit, but can't figure out how to copy all the info in a file window. Is there a way to do this?

    It's easily done with Terminal.
    cd (drag folder into Terminal window, press return). Then:
    ls -l > ~/Desktop/list.txt
    A file called "list.txt" will appear on your Desktop, containing a list of files from the folder, along with their modification dates, file sizes, and ownership/permission info.

  • How to print the report file name and path and the last mod date

    Good morning,
    I am trying to print on the footer of the report the report file name and path as well as the report last modification date.
    Anyone would know how I can do that? I have checked the doc but found nothing.
    Thks. Philippe.

    Did you ever determine how to print report name and report last mod date?
    Thanks

  • How to print file name and date on document

    How can we print the file name and date, like in the old days, on a document as a header or footer?

    Not the print dialog for iWork but in the app itself. Here is Pages:
    Regards,
    Colin R.

  • How to set file name and destination folder without user interaction

    how can I set the file name and destination folder to generate a pdf file like "c:\myfolder\document.pdf" in this folder automatically.
    Is there a tag in .joboptions ?
    Goal: User click print button. In the background a pdf will be generated in e.g. "C:\myfolder\document.pdf".
    that`s it.
    I know that the query dialog for save as can be turned off. But the file name depends on the application.
    Thanks for your help.
    TK

    Hello,
    Please post this  in  PI forums
    Regards, Anil

  • File adapter - How to pass File name and path at runtime

    Hi gurus,
    We want to use PI 7.0 as an ftp server and expose the config as a webservice where the service consumer can pass one or more file names and the path to pick them and drop them on a fixed ftp server.
    So precisely, I need to be able to set the file name, target directory parameters in both sender and receiver file/ftp adapters at runtime. is this possible at all ?
    I am aware of passing Adapter specific parameters from sender file adapter to receiver file adapter to create the same folder structure and file names. But my requirement is different. I hope I am clear.
    Could I please get some advise on this .
    Thanks & Kind Regards,
    Jhansi.

    Hi Jhansi,
    Either you can go ahead with dynamic configuration as said by other SDN'ers. Else can go with Java Mapping:
    Here is the code for Java Mapping:
    import com.sap.aii.mapping.api.*;
    import java.io.*;
    import java.text.*;
    import java.util.*;
    public class GetDynamicConfiguration implements StreamTransformation {
    private Map param;
    public void setParameter(Map map1) {
    this.param = map1;
    public void execute(InputStream inputstream, OutputStream outputstream) throws StreamTransformationException {
    try {
    AbstractTrace trace = null;
    // a) Set ouput File name
    String directory=null;
    trace = (AbstractTrace)param.get(StreamTransformationConstants.MAPPING_TRACE );
    param.put(DynamicConfigurationKey.create("http://sap.com/xi/XI/Dynamic", StreamTransformationConstants.DYNAMIC_CONFIGURATION), "");
    DynamicConfiguration conf = (DynamicConfiguration) param.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
    DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "Directory");
    String filename =conf.get(key);
    conf.put(key, filename);
    trace.addInfo("File name is "+filename);
    if(filename.equals("in.txt"))
    directory = "/home/ftpxi/in";
    if(filename.equals("test.txt"))
    directory = "/home/ftpxi/in/test";
    if(filename.equals("shweta27.txt"))
    directory = "/home/ftpxi/in/test";
    trace.addInfo("Directory name is "+directory);
    conf.put(key1, directory);
    // b) Just copy input file to output file
    byte[] b = new bytehttp://inputstream.available();
    inputstream.read(b);
    outputstream.write(b);
    } catch (Exception exception) {
    exception.printStackTrace();

Maybe you are looking for

  • No Problems @ all

    Hi there, I know this could sound strange for the philosophy of the Forums, but I felt I should post this because most of the times, when I access these Forums is mainly because I have a problem. Sure this is how the Forums were conceived and that's

  • Do I need to keep my apps on my Mac in iTunes if they are now in iCloud?

    Can't I throw out all those apps that are on my MacBook pro taking up hard drive space if I am now using iCloud and getting all my updates over the air to each of my IOS devices? Is there any reason to keep them on the Mac?

  • Local static variable not unique between dylib, Xcode 4.4.1 bug?

    I am wondering if this is a Xcode bug or it is the way the c++ standart is. I would expect to  see 1 in the console but i see 0. Anybody know why? Here is the code In one dylib I have // Header file class Foo {    int i_ = 0;    Foo(const Foo&) = del

  • I've purchased CC and I don't see Media Encoder. Where is it?

    Is Media Encoder included as part of my CC purchase?

  • Location Switching - Access Connections 5.02

    Okay here's my problem, I have 4 profiles set up in Access Connections because I travel between these 4 locations daily.  For some reason, A/C will not automatically switch to the correct profile.  It will start up with the last profile I used and tr