Wed 9th May 2007
Getting Finder Comments in different languages
Posted mid-morning, filed under AppleScript , Python , bash.bash:
mdls filename | grep FinderComment
AppleScript:
tell application "Finder"
comment of file
end tell
python:
#!/usr/bin/pythonw
from appscript import *
path = '/Users/NAME/your/path/here'
comment = app('Finder').items[path.replace('/', ':')].comment.get()
And in python, from bash, without appscript.
comment = os.popen("mdls "+filename+" | grep FinderComment").read().split()[1].strip()[1:-1]30 minutes after the fact.