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)

Similar Messages

  • Hi Everyone,  I am using iPhone5, my question in how to display name and contact number both stored for incoming and outgoing calls? If I have saved five different numbers with a same name, how do I recognise that from which number caller is calling?

    Hi Everyone,  I am using iPhone5, my question in how to display name and contact number both stored for incoming and outgoing calls? If I have saved five different numbers with a same name, how do I recognise that from which number caller is calling?

    I have friends all over Europe, does it matter what number they use to call me? Nope! All incoming calls are free for me.
    The only time you ever have to worry about which number is if you get charged for incoming domestic/international calls.
    You can tag their number (work/home/iphone) and that may show on the CallerID accordingly.
    It should show, John Doe
    underneath,    work/home/mobile
    For example:
    http://shawnblanc.net/images/img-0009-1.png

  • How to force OSX to connect to a specific Access Point i.e. manually choosing beetween different APs with the same SSID?

    My office room is near different APs with the same SSID, my Snow Leopard selects automatically to join the AP with stronger signal.
    But this AP isn't running well, so I want to force my mac to join a AP with weaker signal.
    (I've the same troubel as described in https://discussions.apple.com/message/6470508#6470508)
    Note that I'm a guest user and I hanen't access to APs, so I cannot change their SSID.
    Any idea how to force Mac to join a specific AP?
    Thanks,
    adso

    My office room is near different APs with the same SSID, my Snow Leopard selects automatically to join the AP with stronger signal.
    But this AP isn't running well, so I want to force my mac to join a AP with weaker signal.
    (I've the same troubel as described in https://discussions.apple.com/message/6470508#6470508)
    Note that I'm a guest user and I hanen't access to APs, so I cannot change their SSID.
    Any idea how to force Mac to join a specific AP?
    Thanks,
    adso

  • HT1473 Often times when I copy a CD into my library it breaks the CD into more than one Album, all with the same name but with only a few of the songs on each. This happens whenever the CD has music with more than one artists...like maybe duets.

    Often times when I copy a CD into my library it will break my CD into multiple albums in my library, each with only a few songs.
    Usually this is because there might be songs where the artists has other artists in the song.
    How can I compile all of the different albums (all with the same name by the way) back into one as was the original disc?

    Generally all you need to do is fill in an appropriate Album Artist. For more details see my article on Grouping Tracks Into Albums, in particular the topic One album, too many covers.
    tt2

  • If I manually save the bookmarks, and place them on a different computer, are my login passwords for those bookmarks also going to be transfered?

    Hi guys! Hope you're doing great!
    I want to give some very important bookmarks to a colleague of mine, but for most of them I have passwords saved in Firefox 34.0 (Linux 14.0.4 LTS).
    I am worried that giving her the bookmarks that I have downloaded on my PC from the Import/Export Bookmarks option, will also give her the login passwords for them.
    Is this going to happen or it's ok to send her the needed bookmarks? I do not have another PC on which I can test that at the moment.
    I searched through these recommended articles:
    - Can I restore my bookmarks if they were saved to the same profile on a different computer?
    - why does firefox corrupt my bookmarks every time I load it on a different computer?
    - How can I move all my bookmarks from different Firefox profiles into one area to organize them and then place them into the different Firefox profiles?
    - Where are my logins stored?
    - Restore bookmarks from backup or move them to another computer
    Thank you very much!

    Passwords are stored in the password files (encrypted).
    Bookmarks are stored in the bookmarks file.
    These can't get your data back, but will help in the future.
    These add-ons can be a great help by backing up and restoring Firefox
    '''[https://addons.mozilla.org/en-US/firefox/addon/febe/ FEBE (Firefox Environment Backup Extension)]''' {web link}
    FEBE allows you to quickly and easily backup your
    Firefox extensions, history, passwords, and more.
    In fact, it goes beyond just backing up -- It will actually rebuild
    your saved files individually into installable .xpi files.
    It will also make backup of files that you choose.
    '''[https://addons.mozilla.org/en-US/firefox/addon/opie/ OPIE]''' {web link}
    Import/Export extension preferences

  • How to Copy Items w/ Spotlight Comments?

    Hi all,
    I built my first Automator workflow, but having a slight problem. I'm using the "Ask for Finder Items" action which allows me to browse my image collection. I then use "Review Photos" action to review the photos and I have "Approved images" checked, then finally "Copy Finder Items" action to copy those approved images to a specified folder.
    Here's the problem: I have spotlight comments in the original files that aren't being copied with the file to the specified folder. Can anyone write me a workflow that will properly copy files with the comments?
    Thanks, Bill

    Niel:
    OK, I setup the AppleScript action, but now I'm getting an Error dialog that says "Can't set folder "Users:myusername:Desktop:SelectedImages" to {alias "myharddrive:StockPhotos:iStockphoto:iStock_000000446037Medium.jpg"} plus any other images I selected w/ error (-10006)
    I thought the problem might have been the spaces in folder names, so I took all spaces out, but to no avail. Any suggestions?
    Thanks, Bill

  • How to copy DNG images from MacBook Pro onto a flashdrive and paste them into my pictures on my iMac

    When I tried to do this, I couldn't get the image on the flashdrive to open in photoshop. Each time I tried I got a message that said photoshop had crashed. When the flashdrive is plugged into the MacBook the image files look like images. When the flashdrive is plugged into my new iMac (Maverick) the image files just show the DNG icon. Both computers have the Creative Cloud.

    iTunes: How to move [or copy] your music to a new computer [or another drive] - http://support.apple.com/kb/HT4527
    Quick answer if you use iTunes default preferences settings:  Copy the entire iTunes folder (and in doing so all its subfolders and files) intact to the other drive.  Start iTunes with the option (shift on Windows) key held down and guide it to the new location of the library.
    So, you can see your whole iTunes folder on the memory stick after copying from the PC?

  • Can a script be written to take the next 2 files in a folder and place them on a background image..then saving with the first images filename..?

    Hello all, I hope you can help.
    In Photoshop I have a problem to overcome and have delved into the world of scripting..
    If there is a quick way to produce the following could someone help me with some pointers?
    Here is my situation..
    I need to produce a photograph proof card, these are for a double image option so cause me a headache compared to just creating an action..
    This proof card really is just a set of two different photographs placed onto a background image.
    I would produce two different images of the same person and name them exactly the same except they are suffixed with an A or B to keep them together, these would be in a folder with approx 500 other images for example (250 x two of each person)
    My preference for the process would be done in the following sequence:
    1/ Open the background file jpg (which is sized at 2400 x 1800 pixels @ 300dpi)
    2/ Load the first image from the batch file and place this.
    3/ Get the filename of the first image and create it as a text layer and write it below the image at 10 point text size.
    4/ Create another copy of this layer and change the font to 3of9barcode font, however the font needs an asterisk before the text then again after it. e.g. *filenameA*
         Only the first image has the need for a barcode as they are for the same person. This is at 18 point.
    5/ Load the next sequential image from the batch file and place this.
    6/ Get the filename for the second image and as Item 3/ create a text layer below at 10 point text size.
    7/ Place a png overlay with my copyright information over the images (I need to do this twice, once for each image)
    8/ Flatten the images and save the file in a new folder with the same filename as the first image.
    I can do this in Lightroom with the exception of putting the barcoded text, and the filenaming, this is because the background image is used as the identity plate and the filename is not based on the data from either photograph..
    Can anyone shed some light on where to go from here?
    Kind regards
    Bryan

    Photoshop Scripting-wise this seems fairly "easy".
    But I would recommend creating a template file (that already combines background image, png overlay and the Type Layers).
    Maybe data driven graphics would also be an option …
    Photoshop Help | Creating data-driven graphics

  • Extracting the first page from all pdf's in a folder and save them to a new file

    Hi,
    As Bridge apparantly is unable to create a decent-looking PDF from a bunch of other PDF's, we're looking for alternative solutions. The problem is, that I haven't done much scripting in Acrobat.
    Pseudocode:
    Select Folder where PDF files are stored
    Create list of PDF files
    Get first page from each and add it to temporary new PDF
    Save temporary new PDF in high quality
    Would that be possible in Acrobat? And where would I start? I can't even find a Scripting Guide for Acrobat (like the ones for Illustrator and InDesign).. and there seems to be no sample scripts included either :-(
    Thanks,
    Thomas

    This can be done using a combination of an Action and a script. The script in the Action will collect the paths of the files you want to process and the folder-level script will extract the first page from each file and generate a new PDF from it. You don't need a plugin for this task, so you don't really need the SDK.
    The Acrobat JavaScript Reference can be found here: http://www.adobe.com/devnet/acrobat/javascript.html

  • How do I make disappeared Spotlight Comments Reappear

    My spotlight comments in an entire folder have disappeared. However, the files do show up if I search in spotlight for a word which was in the comments. How do I make the comments reappear?

    Draw the sahpe as a shape, not as pixels by using the proper button on the horizontal tool settings bar for the shape tools.
    Mylenium

  • Unable create a target file with the same name

    Hi,
    I have to pick an attachment from a web service and place the attachment in
    a folder, with the same name (Attached File Name). I tried this using SOAP to file
    scenario. Using SOAP, I'm able to get the attachment inside PI with the same
    name, but not able to generate the file in the receiver end.
    Please let me know if this is possible or else is there any other way to do
    it.
    Regards,
    Deepak Ravi

    Check also:
    Combining three different aspects of PI (ASMA, AF Module and variable substitution) in one shot
    Dynamic Configuration vs Variable Substitution - The Ultimate Battle for the File Name
    Regards

  • 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

  • I had previously purchased the programs "Pages" and "Numbers" and they are on my iPhone and iPad I was told that the programs would automatically copy a version of itself for the iMac to be running them but I don't see it installed. How can I install them

    I had previously purchased the programs "Pages" and "Numbers" and they are on my iPhone and iPad I was told that the programs would automatically copy a version of itself for the iMac to be running them but I don't see it installed. How can I install for free?  I see that I could go to the apple store and purchase them again but I belibve that since I had already purchased them; I would get a free copy for my Imac.  Do I got something confused here?  Please help.

    Whoever told you that was misinformed or lying. Those applications are sold separately for the iOS platform and the Mac platform.
    Go to the Mac App Store to purchase Pages and Numbers for your Mac. They're $20 each. If you are running an older version of Mac OS X that can't use the Mac App Store, you can purchase install media from Apple.

  • How do I have itunes use/detect my external hard drive and place music on the external drive from the itunes store? There are no music files on my pc yet.  I will like to do this after installing itunes 11 on my pc for the first time. I am using windows 7

    How do I have itunes use/detect my external hard drive and place music on the external drive from the itunes store? There are no music files on my pc yet.  I will like to do this after installing itunes 11 on my pc for the first time. I am using windows 7.  HP computer intel Dual Core.  Thanks for any help!

    Hey idw3,
    Welcome to Apple Support Communities, and thanks for the question. Follow the instructions on this article to move your iTunes Media folder to an external hard drive:
    iTunes for Windows: Moving your iTunes Media folder
    http://support.apple.com/kb/HT1364
    Regards,
    David

  • Ask for Text for Set Spotlight Comments for Finder Items

    I want the text from the "Ask for Text" to go in to the "Set Spotlight Comments for Finder Items" action, but they don't seem to interact.
    Any ideas?

    first you make a new variable using variables tab. then you add the action "set value of variable" right after the action ask for text. drag the variable you made to the variable field of that action. this will set the value of that variable to the output of the previous action.

Maybe you are looking for

  • Web Service Help

    Hi, I am new to Web Service. I am trying to create my first web service in jdev enviorment. I have created a methos whicjh return a string value. I have generated the wsdl, web.xml from jdev. Also generated the client from jdev. Deployed the ws in my

  • RRI Reports - Tables

    Hi all, I have a list of queries and Web templates. I want to know if there are any RRI Reports built on these queries. Is there any table from which I can fetch this information?? For e.g. I have one XYZ query. i need to find if there any RRI report

  • Low image quality when working

    When I am working in Photoshop and zoom out on the image it gets really noisy at quality gets quite low but when you zoom in enough to work it smooths its out get back's to normal quality. I was looking at preferences settings to find the reason but

  • Usual computer crashes during synchronisation. Can I trust my PC to update my iPod anymore?

    OK, While my iPod touch 4G is Sync-ing with my netbook (Acer aspire one, Win 7 starter) I get a pop-up error diologue box; "iTunes has crashed and needs to be closed. Sorry for this inconveinience" -Do excuse my spelling ;D Should I trust this PC to

  • I need to know how to reload  my copy of Adobe Photoshop Elements 11

    i Need to know how to reload my copy of Adobe Photoshop Elements 11