• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Setting spotlight comments
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting spotlight comments


  • Subject: Re: Setting spotlight comments
  • From: Christopher Stone <email@hidden>
  • Date: Sat, 18 May 2013 15:52:37 -0500

On May 18, 2013, at 05:40, JF <email@hidden> wrote:
I have 100s of files which need to have a particular spotlight comment. I can do this manually by opening the "Get Info" dialog box, but this is very time consuming. Is there a way of selecting an file (or a whole lot of files) and applying an appleScript which will automatically place the spotlight comment.
______________________________________________________________________

Hey JF,

It's better to use an alias list in the Finder than Finder-References (much faster in general).

This script will handle one or more selected files.

It works around the Finder-selection bug in Lion/ML.

Many hundreds of files will take a long time and possibly lock up the Finder for an extended period, but a few hundred at a time shouldn't prove to be much of a problem.

Testing with 256 files selected on my machine this script takes:

~ 5.5 seconds when run from Script Debugger.
~ 2.1 seconds when run from FastScripts.
~ 2.3 seconds when run from Keyboard Maestro.
~ 2.2 seconds when run from Smile.
~ 2.3 seconds when run from the Applescript Editor.

--
Best Regards,
Chris

-------------------------------------------------------------------------------------------

try

  

  set _comment to "This is your life Charlie Brown"

  

  tell application "SystemUIServer" to activate
  tell application "Finder"
    activate
    set _sel to selection as alias list
    if _sel ≠ {} then
      repeat with _alias in _sel
        set comment of _alias to _comment
      end repeat
    end if
  end tell

  

on error e number n
  set e to e & return & return & "Num: " & n
  tell me to set dDlg to display dialog e with title "ERROR!" buttons {"Cancel", "Copy", "OK"} default button "OK"
  if button returned of dDlg = "Copy" then set the clipboard to e
end try

-------------------------------------------------------------------------------------------

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Setting spotlight comments (From: JF <email@hidden>)

  • Prev by Date: Re: Setting spotlight comments
  • Next by Date: Re: InDesign Separations
  • Previous by thread: Re: Setting spotlight comments
  • Next by thread: Script Debugger Session Dump
  • Index(es):
    • Date
    • Thread