Friday, May 24, 2013

little script to add Spotlight comments to selected files/folders

Below is a applescript to automate Spotlight commenting, for selected files and folders.

Spotlight comments are way underused, I recon. I use them kinda like a Version Control Management technique, in a way.

Makes life easier (at least for me) to find stuff without doing smarty pants folders....


(* 
Simple script allowing Spotlight commenting for selected files and folders.
created by griffin byron for puginabox.com *)

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
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
beep
end tell

No comments:

Post a Comment