I found a script By Chris Barber which is very close to what I am trying to accomplish:
http://macscripter.net/viewtopic.php?pid=132545#p132545
the scripts inserts the same comment in the “Get Info” window to all files from a specific folder. Instead I need to put a different comment for each file located in my chosen folder. I need to insert the actual file name (not the path) without the extension.
I hope someone can help me to place the file name in the comment as a new comment till the end of the repeat
I will be very grateful to anyone who can help to modify the script.
Thanks
This is Chris Barber’s original:
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