• 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: JF <email@hidden>
  • Date: Sat, 18 May 2013 13:04:47 +0100

I have found an automator solution from <http://www.applesprite.com/blog/2010/07/12/adding-spotlight-comments-overcoming-finders-limitations/>

For interest (perhaps) the site includes a script which appends or overwrites Spotlight comments, but it does it to every file in a folder. I just wanted the selected file(s) to have the comment.
___________________________
tell application "Finder"
	activate


	try
		set thisFolder to (target of front Finder window) as alias
	on error
		choose folder with prompt "Set comments of files in this folder:"
		set thisFolder to result
	end try


	display dialog "Comment:" default answer "" with title "Set Spotlight Comments"
	set newComment to text returned of result

	display dialog "How to handle existing comments?" buttons {"Overwrite", "Cancel", "Append"} default button 3 with title "Set Spotlight Comments"

	if (button returned of result) is "Overwrite" then
		set comment of every file of folder thisFolder to newComment
	else
		get every file of folder thisFolder
		repeat with thisFile in result
			tell thisFile
				if length of (comment as text) is not 0 then
					get ", " & newComment
				else
					get newComment
				end if
				set comment to (comment & result)
			end tell
		end repeat
	end if


	beep
end tell
_____________________________________________________


Sat, 18 May 2013 11:40:08 +0100, JF  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. If opening the Get Info box is required this is done
>without display.
>
>Spotlight is a preference pane in System Preferences and I don't know
>how to script it directly. I have tried this in both Finder and System
>Preferences, but neither work:
>
>tell application "System Preferences" -- or "Finder"
>	set comment of selection to "Set 2"
>end tell
>
>
>
>
> _______________________________________________
>Do not post admin requests to the list. They will be ignored.
>AppleScript-Users mailing list      (email@hidden)
>Help/Unsubscribe/Update your Subscription:
>@fmail.co.uk
>Archives: http://lists.apple.com/archives/applescript-users
>
>This email sent to email@hidden



 _______________________________________________
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

  • Follow-Ups:
    • Re: Setting spotlight comments
      • From: Lists <email@hidden>
References: 
 >Setting spotlight comments (From: JF <email@hidden>)

  • Prev by Date: Setting spotlight comments
  • Next by Date: Re: Setting spotlight comments
  • Previous by thread: Setting spotlight comments
  • Next by thread: Re: Setting spotlight comments
  • Index(es):
    • Date
    • Thread