I'm trying to get spotlight comments with python. All I need now is the ability for popen to return whatever the shell would normally output if running the same thing. once i have a string in python then I can filter it properly.
import sys, os, glob
paths = glob.glob("*.wav")
print paths
for soundFile in paths:
#soundFile = os.path.abspath(soundFile)
result = os.popen("xattr -p com.apple.metadata:kMDItemFinderComment "+soundFile+" | xxd -r -p |plutil -convert xml1 -o - -")
print result