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

Similar Messages

  • I need help trying to access my spotlight messages.

    I need help trying to access my spotlight messages.  I type in the persons name and only one text comes up but when I type in words in the text other ones come up.  So what I need to do is get all those text messages if its possible.

    I know the texts are there, but like I said it depends on the spotlight search but I want them all in one.

  • How to Import Spotlight Comments into iPhoto

    Is there a way to import Spotlight Comments into iPhoto at the same time I bring in the image?

    Afraid not. You will need something to convert those comments into standard photo metadata like Exif or IPTC.
    Regards
    TD

  • Need help for publishing web intelligence document (universe) into InfoView

    Post Author: mirage
    CA Forum: Publishing
    Hello all,
    I need help for publishing web intelligence document (universe) into InfoView.
    can't find this information in Business Objects Designer's Guide and in Business Objects Administrator Guide.
    Can somebody give short instructions how can I do it?
    Regards, Slava

    If the change between the 2 types of data has to happen dynamically during run time them
    1. Use 2 dataproviders
         a. Current
         b. Historic
    2. Merge the 2 dimensions
    3. Use Webi variable to switch between the measure of the current and historic universe
    Ex  if [year] < 2010 then historic.[expense] else current.[expense]
    Hope this helps,
    Divya

  • I need help! when I am importing my NEF files from my D3300 camera into lightroom 5 and try to use the "copy as DNG" button I always get an error message saying that "saying the file is not recognized by the raw format support"

    I need help! when I am importing my NEF Raw files from my D3300 camera into lightroom 5 and try to use the "copy as DNG" button I always get an error message saying that "saying the file is not recognized by the raw format support". The whole purpose of that button is so that the file can be recognized... How can I make the "copy as DNG" button work as it is supposed too?? Thank you

    Thank you for responding. So I essentially will never be able to use that button in lightroom 5? do I need to get LR 6? Will there ever be an update for LR 5 that will enable me to use it?
    Does DNG Converter work within LR or do I have to upload pictures to my computer and then make a second copy in DNG format. and then go into LR and use them?
    Thank you @dj_paige

  • I need help modifying a script in IPCC

    I am running UCCX Premium 5.0(2)SR02_Build045. I have a script in place, but need to modify it. Basically a call comes into my main menu and gets distributed to a contact service queue. If no agents are available the call is queued and the caller is prompted to leave a voicemail after 2 mins. If the caller continues to hold they will stay in queue. I need to modify the script so that all callers are dequeued after 15mins. The call can be terminated or routed back to my operator (0). Any help appreciated I am a scripting newbie!
    By the red arrow is the QueueTransfersLoop. I need to modify this loop to terminate after 15mins.
    Thanks!!
    Chris

    Hi Chris,
    You need to drop the get reporting statistic step in some place of the queue loop, in the get reporting statistic step properties you have to choose for the Report Object parameter the one that says "CSQ IPCC Express", in the Field parameter you have to choose "Current Wait Duration", the Row Identifier is a string variable that has the value of the CSQ name and finally Result Statistic is an integer variable that you have to set to 0.
    After that you need an if statement, in that step you have to compare the value of the Integer variable with some value, in this case the 15mins that you need (you have to compare the values in seconds). It's better to compare the value with a ".equals()" and also with a ">="  because it could be that the call has being queued a little bit more than 15 mins.
    Check the screenshot, that works for me.
    Gabriel.

  • I need help modifying my iWeb site from another Mac than the one it was designed on:

    I did exactly as directed in the Help file "to Modify your site from another computer", but when I click on the Domain file it launches iWeb to start a new website without anything from the site I created. The Macs are a mirror image of each other with the same iWeb version 3.0.4. I am transitioning from my MacBook to my new iMac, so the laptop files were all transferred to the iMac by the Apple Store when I bought it. The only difference is that the laptop is OS 10.6.8, and the new iMac is OS 10.7.5. After the transfer of all the files at the store, I proceeded to make the website on the laptop, but now need to work on the website from my iMac...but I need help getting the file to work on the iMac.
    PLEASE HELP!
    Thanks!

    The trick that solved it for me was the last note about how to make the hidden folder appear (due to Lion OS 10.75):
    Note for OS X Lion users :
    To show the hidden Library folder in the Home Directory (Cmd-Shift-H) hold the Option (=Alt) key when choosing theGo menu in the Finder.
    Thanks!

  • Need help creating applescript to perform automator actions.

    Hi,
    I am looking for help with an applescript the will tell automator to execute  the steps of a workflow.  I'm aware that I coud just run a workflow or even tell applescript to instruct automator to run the workflow, however, I am looking to make this part of a larger workflow and this method would save the hassel of having to create a new workflow outside of applescript each time.
    I would like automator to "get folder contents" then "extract pdf text" to a "new file" with the "same name as original file" in the "same location as original" and "save as txt".  This doesnt seem to difficult to me, however, I have limited knowledge of scripting at this time.
    I appreciate anyones help...

    Hi,
    I'd say on a difficulty scale of 1-10, what you're asking for is a seven.
    Automator is scriptable, but when you run a basic AppleScript like
    tell application "Automator" to make new workflow
    you immediately get taken to the dialog asking you to choose a type for your document (app, calendar plugin etc). So that's going to stop the AppleScript dead in its tracks. It might be possible to move on with GUI scripting (using AppleScript to click the buttons) but it would be a ferocious cludge.
    I think the best approach would be to manually create an empty action as a starting point. You would then need an AppleScript that would duplicate the workflow file (so you've got a fresh one to duplicate next time), open it in Automator, add the appropriate actions, set the settings etc.
    It all sounds a bit too complicated
    HD

  • I need help with AppleScript for changing the font on numerous PowerCADD files

    I am currently trying to write an AppleScript, but I really have no idea how one is written.  I have looked up many tutorials, but to no avail.
    What I'm trying to so is write a script that will take all my selected PowerCADD files, open them, change the font to Helvetica, then save the file.  I have over a thousand files to do this to.  So, you can see my need of an AppleScript to get this task completed.
    If anyone out there knows how I would write this script, please submit it here.
    Thank you so much for your time and help.

    If anyone could help, that would be awesome  =)

  • I NEED HELP WITH APPLESCRIPT!

    choose from list {"edit dock looks", "dock delay time", "make your own dock background", "edit toolbar", "open background prefrences", "edit icons"} with prompt "how would you like to edit your mac?"
    if result is "edit dock looks" then
    tell application "cDock"
    open
    end tell
    else
    if result is "hide toolbar" then
    tell application "Menue Eclipse 2 Demo"
    open
    end tell
    else
    if result is "open background prefrences" then
    tell application "System Prefrences"
    open
    end tell
    else
    if result is "dock delay time" then
      choose from list {"0","1","2","3","4"} with prompt "How many seconds delay would you like?"
      if result is "0" then
      tell application "Terminal"
      do shell script "defaults write com.apple.dock autohide-time-modifier -float 0"
      delay 1
      do shell script "killall Dock"
      quit
      end tell
      else
      if result is "1" then
      tell application "Terminal"
      do shell script "defaults write com.apple.dock autohide-time-modifier -float 1"
      delay 1
      do shell script "killall Dock"
      quit
      end tell
      else
      if result is "2" then
      tell application "Terminal"
      do shell script "defaults write com.apple.dock autohide-time-modifier -float 2"
      delay 1
      do shell script "killall Dock"
      quit
      end tell
      else
      if result is "3" then
      tell application "Terminal"
      do shell script "defaults write com.apple.dock autohide-time-modifier -float 3"
      delay 1
      do shell script "killall Dock"
      quit
      end tell
      else
      if result is "4" then
      tell application "Terminal"
      do shell script "defaults write com.apple.dock autohide-time-modifier -float 4"
      delay 1
      do shell script "killall Dock"
      quit
      end tell
    else
    tell application "LiteIcon"
    open
    end tell
    end if
    HELP

    One more time doing this
    choose from list {"0","1","2","3","4"} with prompt "How many seconds delay would you like?"
      if result is "0" then
    will never work. Choose from list returns a list unless the user presses cancel in which case it returns false.
    You need to modify the test to something like this (asking you do not allow multiple value to be selected from the list)
    if item 1 of result is "1" then
    or this
    if result contains "1" (as VikingOSX showed)
    Try this (based on Viking's example)
    setdefaultStr to "defaults write com.apple.dock autohide-time-modifier -float "
    choose from list {"0", "1", "2", "3", "4"} with prompt "How many seconds delay would you like?"
    try
      set argVal to item 1 of result
    on error errStr number errornum
      if errornum is -1728 then -- getting item 1 of result failed, result is not a list
           display dialog "User pressed Cancel"
           quit
    else
           display dialog "unknow error:" & " " & errornum
           error errStr number errornum
      end if
    end try
    do shell script "echo " & defaultStr & argVal
    delay 1
    do shell script "killall Dock"
    beep 1
    regards

  • Add Spotlight Comment from file?

    As I understand the way the *Add Spotlight Comments* works, the input is the file (or set of files) to be modified, and the added comments can either come statically from the workflow, or as user input if the workflow permits *Show Action When Run*.
    I have a moderately ugly shell script that downloads and examines a succession of files and builds a description (just a few dozen words) that I want to add automatically to those comments. At the end of my script, I've downloaded the file, and stored the comments I want in a separate temp file.
    As far as I can see, Automator can't do this: I can't specify a file as the incoming source of those new Spotlight Comments, can I?
    Assuming the answer is negative, two quick non-Automator followups:
    1) Is there any shell-script level Unix command that can manipulate the comments (without trying to hack into the .DS_Store files, that is).
    2) Can Applescript do this? And, crucially, where's the best current help for Applescript for someone that hasn't touched it in many years?

    Automator can do it, although some of the actions may not be obvious. Text (for example, the results of your ugly shell script) can be placed into a variable for later use, but you can also get it from a file. If your description/comment is in a plain text file, you can use the Combine Text Files action to get the text, then place it in a variable that can be used with the Set Spotlight Comments for Finder Items action.
    Example:
    1) Get Specified Finder Items (add your description file) (ignore input)
    2) Combine Text Files
    3) Set Value of Variable {Variable: whatever}
    4) Get Specified Finder Items (add the file you want to comment) (ignore input)
    5) Set Spotlight Comments for Finder Items {drag variable whatever to the text field, Append to existing comments}

  • Help with Automator to copy text from multiple files

    Hello,
    I'm new to automator and applescript but it seems like what I'm trying to accomplish is fairly easy.
    I'd like to run a workflow that will open a text file, copy the contents, paste the contents into a given application and then take a screenshot.
    I'd like to be able to do this for several hundred text files.
    I've tried with a Service but can't figure out how to provide the text input after "Get Specified Finder Items".
    Get Specified Finder Items --> Get Contents of TextEdit Document --> Copy to Clipboard --> results in no data.

    You'll need to use Applescript (you could use the Automator Run Applescript Action).
    set recipientAddress to do shell script "cat <filename.txt>"
    set theSubject to "Type your subject here!"
    set theContent to "Type your message content here!"
    tell application "Mail"
      activate
              set theMessage to make new outgoing message with properties {subject:theSubject, content:theContent, visible:true}
              tell theMessage
      make new to recipient with properties {address:recipientAddress}
      -- Uncomment send to Send the Message:
      -- send
              end tell
    end tell

  • Need help to open audios attached in a PDF file

    Hello
    I just need help. I have ordered a reviewer online that has audios and texts in a pdf file. I was told to download the latest adobe reader on my computer. I have done the same thing on my ipad mini. I am not so technical with regards to these things. Therefore I need help. I can access the audios on my computer but not on my ipad.
    I want to listen to audios with scripts or texts on them so i can listen to them when i am on the go. I was also informed that these files should work in any device. How come the audios doesnt work on my ipad.
    Please help me on what to do.
    Thanks

    Audio and video are not currently support on Adobe Reader. :-<
    You need to buy a PDF reader that supports them. My suggestion is PDF Expert from Readdle ($US 9.99)

  • Need Help! No Video Just Audio With .AVI Files

    i got quicktime for my iPod, just only for that cause i think that quicktime really *****... i searched this whole site for an answer. i found something i thought would solve my problems with .avi files but my .avi files are mpeg-4 layered, and there's only a descent answer for indeo files? or something like that. i really need help cause i want to convert an ordinary .avi file to iPod extension... please please help!!!!!!!!!!!!

    There is no single codec for movies that have .avi extensions. AVI is a container format, not a specific type of file. An AVI movie may use one of the Indeo codecs or one of the various flavors of DivX, among other possibilities. You'll have to find out what codec was used for the movies you want to view to determine what you need. Note that not all codecs for the various .avi movies are available for QuickTime.
    If you want to try "hit and miss", you can try the codecs at http://www.divx.com/ and http://www.3ivx.com/ and see if one of them will work for you

  • Need help from users familiar with Crossover & installing Poser files.

    I have the latest version of Crossover, and only experienced this problem recently.
    I want to run exe install files (from DAZ3D, and some self-extracting zip files I created), and install content into my Poser installations.
    I used to just click, and run the install.
    Now, all I get is some welcome message, with a bunch of options I don't understand... bottles, and such.
    Can anyone help me understand how to make this work?

    I have the latest version of Crossover, and only
    experienced this problem recently.
    I want to run exe install files (from DAZ3D, and some
    self-extracting zip files I created), and install
    content into my Poser installations.
    I used to just click, and run the install.
    Now, all I get is some welcome message, with a bunch
    of options I don't understand... bottles, and such.
    Can anyone help me understand how to make this work?
    To start off, basically Crossover uses WINE which frames programmes in bottles. Bottles can be various windos versions and you can have several. This is a virtualisation technology. Can you post images of the screens that you are seeing.
    For more info go to their site for online documentation:
    http://www.codeweavers.com/support/docs/
    To get more technical: there is a way to install unrecognised programmes. It does involve access to Windows. 1)install program on Windows 2) copy installed file information(folders, dll...) 3) copy registry information((careful here)) go to start>run>regedit in regedit search for program name and export information. 4)copy over folders into proper bottle and import the exported registry info into the same bottle. and that should work. (SOME PROGRAMS MAY NOT JUST WORK YET WITH CROSSOVER, PLEASE BE PATIENT WHILE THEY UPDATE)
    Message was edited by: DJ_Boxer

Maybe you are looking for

  • Address Book Version - Google Sync

    I have my iMac address book synced to Google Contacts and wanted to set up my Powerbook the same way but didn't find the same setup screens. When I checked, the Address Book version on my iMac is 5.0.1 (864) and on my Powerbook it is 4.1.2 (702). I t

  • Creation of previews/thumbnails of PSD files not working in v3.0.1

    I'm using Aperture 3.0.1, PS 4 to edit photographs. My workflow will be the usual, Photo > Edit with Adobe PS, in my Aperture browser thumbnails/previews will be created for the PS file. When I save my work in PS, the thumbnails and previews in Apert

  • Unusual issue with tag engine and BELKIN USB to Ethernet adapter??

    I have an .scf file with 72 tags and several tag groups in it. If I open the tag engine without the usb adapter, I can read the tag group names with the get group list.vi. The tag group names are listed in black letters when wired to an indicator. Wh

  • Corrupted Template Folder In Mail

    In attempting to create a custom stationery template, I apparently  corrupted one of the template folders.  The folder is resident, but when I open it within Mail, and select Stationery, all templates in that folder simply have a frame around each on

  • TCA API create_location creates locations irrespective of the address style

    Hi All, We are using Trading Community Architecture API for customer conversion. We have address styles setup for Canada and US and we have attached these address styles to the respective countries in the territories window. But when we use create_lo